Fixes issue #52: Event detection for variable # of events.