Bugfix for state.