fix `min`/`max` mixup

[proof](http://i.imgur.com/Y1g20vC.png)
Merge pull request #479 from vprimachenko/patch-1

fix `min`/`max` mixup