misc maintenance and bug fixes

Some XMPP dependent code was not properly contained.