Fixed issues with messages not being removed from the queue;