Small changes to event code