Better error reporting in report.php