Fixed memory leak in _cmd_join

issue #226
Fixed memory leak in groupchat logging

issue #226