Fix to work with ejabberd 14
More fixes to work with ejabberd 14