fixes to error reporting