Fixed messages not being added to the chat history

Fixed messages not being added to the chat history and ClientCommandHandler not being called when sleeping (client side commands are ignored).