Fix crash when using the state calculator.