Some fixes for XMPP