Fix sorting that was implemented poorly in the last checkin.