Fixing a bug in MessageQueue::removeIf() that leads to an