Bugfixes in chat controller