Finally fixed changing state errors.

Was a typo.

Thanks, Makis.