Issue #141: state_set() needs to update static states variable if it already exists.