Fix crash with setupStateToString()