Fix a bug with PriorityQueue