Bugfix sorting