fix min/max and minmag/maxmag documentation to reflect actual behaviour + simplify implementation of minmax/maxmag