Added some utility methods to the StateMachine.