Fixed stupid typo in max and min functions.