minor changes to error reporting.