Remove the use of min max macro