Switch from min() to MIN() to ensure that our macro doesn't interfere with std::min or other mins

Also, our min macro was missing a semicolon
[cosmetic] Remove end-of-line whitespace