Fixed problem with duplicate ends to events.