Bugfix on sorting upward