Bugfix for sort.