Fixed a problem in error reporting