Fix sorting for qualification