Fix priority queue so that it could enqueue more than one of the same priority.