Fixed a defect in the queue prioritization where it was not choosing correctly.