Fix max() and min() on non-numeric data