Tweaks of maximum and minimum related functions
Merge pull request #7038 from lindahua/dh/maxmin2

Tweaks of maximum and minimum related functions