Index: src/Common/ScopedMap.h
===================================================================
--- src/Common/ScopedMap.h	(revision 97d246da445a8795c4b899478cd650136325c2ef)
+++ src/Common/ScopedMap.h	(revision e58dfb989674544981dfc936425231e7fa5edd1c)
@@ -230,4 +230,14 @@
 	}
 
+	/// Finds the given key in the provided scope; returns end() for none such
+	iterator findAt( size_type scope, const Key& key ) {
+		typename Scope::iterator val = scopes[scope].find( key );
+		if ( val != scopes[scope].end() ) return iterator( scopes, val, scope );
+		return end();
+	}
+	const_iterator findAt( size_type scope, const Key& key ) const {
+		return const_iterator( const_cast< ScopedMap< Key, Value >* >(this)->findAt( scope, key ) );
+	}
+
 	/// Finds the given key in the outermost scope inside the given scope where it occurs
 	iterator findNext( const_iterator &it, const Key &key ) {
Index: src/GenPoly/InstantiateGeneric.cc
===================================================================
--- src/GenPoly/InstantiateGeneric.cc	(revision 97d246da445a8795c4b899478cd650136325c2ef)
+++ src/GenPoly/InstantiateGeneric.cc	(revision e58dfb989674544981dfc936425231e7fa5edd1c)
@@ -122,5 +122,10 @@
 		/// Adds a value for a (key, typeList) pair to the current scope
 		void insert( Key *key, const std::list< TypeExpr* > &params, Value *value ) {
-			instantiations[ key ].push_back( Instantiation( TypeList( params ), value ) );
+			auto it = instantiations.findAt( instantiations.currentScope(), key );
+			if ( it == instantiations.end() ) {
+				instantiations.insert( key, ValueList{ Instantiation{ TypeList( params ), value } } );
+			} else {
+				it->second.push_back( Instantiation{ TypeList( params ), value } );
+			}
 		}
 	};
