Fixing event bugs