Add error reporting for debugging