Fix a typo in mate sorting.