Added a fix for the context of events.