Fixed min and max handling