Fixed priority queue bugs.