Fixes a few compiler issues in state machine