Updating character states (fix logic errors).