Add extra parenthesis around terms in the common MIN() and MAX() macros to prevent issues with non-trivial macro inputs (thanks to David Lyons).