fixed bug with return type as well as sanity check in name extractor