Type safe MIN/MAX macros