Fixed bug in queueing initial messages, refactored out flushMessageQueue and queueSelector: