Fixed a state bug.