Fixed max() to min()