Add error checks.