Merge pull request #1463 from pellyadolfo/master

fix for max/min functions