Fix bugs in the integration with MwebEvents

Bugs generated after beea9987da44b1