Added some error checking to EventPriorityQueue