Fix a possible corruption/crash when name lookups fail, due to incorrect error checki...