Update from adamcduke for ejabberd 13 compatibility