Fixed stateMachine destructor and made test.