Simplify error checking.