Fix bug in error reporting.