Fix errors in `sortQueue()`

I had forgotten to break the loop after the speed tie and to push
decisions decided by pre-existing tie order to the queue. Fixed here.