Fix max and min methods