Enhanced error reporting
Enhanced error reporting code