Fix sorting of output.