Fix error when sort by name.