Switch some calls to to_stderr to report_error and report_warning