fix some error reporting