Added initial logging of errors.