Fixed error reporting.