Fixed bug in send and in receive of chat messages.