#6409: Use sort that maintains keys.