minMaxLoc
some fixes