Improve the error reporting.