Fixed sorting of pages using PriorityQueue()