Fixed some bugs in the xmpp client