Fix sorting of arrays.