Fix minor bug in ReportError