Fixing bug with elements not being correctly removed from DynamicPriorityBlockingQueue.