Fix sorting, properly this time