Moved the error checks into debug statements