Index: src/ResolvExpr/RenameVars.cc
===================================================================
--- src/ResolvExpr/RenameVars.cc	(revision 8fb740249fbce2fa4fbb7d260002c72b55b18605)
+++ src/ResolvExpr/RenameVars.cc	(revision f76dd1adda60db081c9d143fad2048e7f9700c7c)
@@ -83,17 +83,14 @@
 
 		const ast::TypeInstType * rename( const ast::TypeInstType * type ) {
-			// rename
 			auto it = idMap.find( type->name );
-			if ( it != idMap.end() ) {
-				// unconditionally mutate because map will *always* have different name
-				ast::TypeInstType * mut = ast::shallowCopy( type );
-				// reconcile base node since some copies might have been made
-				mut->base = it->second.base;
-				mut->formal_usage = it->second.formal_usage;
-				mut->expr_id = it->second.expr_id;
-	            type = mut;
-			}
-
-			return type;
+			if ( it == idMap.end() ) return type;
+
+			// Unconditionally mutate because map will *always* have different name.
+			ast::TypeInstType * mut = ast::shallowCopy( type );
+			// Reconcile base node since some copies might have been made.
+			mut->base = it->second.base;
+			mut->formal_usage = it->second.formal_usage;
+			mut->expr_id = it->second.expr_id;
+			return mut;
 		}
 
@@ -187,5 +184,4 @@
 
 const ast::Type * renameTyVars( const ast::Type * t, RenameMode mode, bool reset ) {
-	// ast::Type *tc = ast::deepCopy(t);
 	ast::Pass<RenameVars_new> renamer;
 	renamer.core.mode = mode;
