Fixed an issue with StateMachine where code that handles a transition event and initiates another transition would cause other handlers for the first state to get run late. Fix is to defer transition chanes until after the current transition completes.