Fix sorting test