Reworked error reporting.