fixed 2 issues

these were just problems brought on by the merges from the last few days
so one issue must have been the missing sort; what is the second issue? is it some conflict caused by this code?