Clean up name comparison and lookup functions.