Some fixes in chat module