Fixed a bug in the state system.