Maxima and minima improvements