Fixes to events system