Fixing some bugs in report_erros()