Fix sorting of expand