Fix encoding state check.