Fixing syntax and script error

I found these two seem to fix statemachine.