Add missing state reset on event emission

When eimitting an event, we also have to reset the state.