Minor optimisation in min() and max() functions.