Simplify error check.