Added context setting for events.