Fix sorting of listed elements.