Fix error messages for state checking.