Fixed max/min functions.
Merge pull request #132 from kengruven/master

Fixed min/max