Rename has to haskey in PriorityQueue.