Patch ejabberd_sm.erl