Simplify the error check.