Fixed bug in collect-event-types function