Fix regression in max/min
Merge pull request #1749 from megawac/min/max-reg

Fix edge-case regression in max/min