Fix type confusion in EntityStateMachine.