Finite state machine changes.

You cannot raise or clear events in the enter, leave or activate functions.  Doing this generally means a poor FSM design.

Events are cleared on any state transition rather than immediately.