Fix sorting for p3a