Fixes for StateMachine.