Fixed error reporting issue.