Fixes for message queue thread.