Index: src/ResolvExpr/ResolveAssertions.cc
===================================================================
--- src/ResolvExpr/ResolveAssertions.cc	(revision fbecee54da078ee561a27cf4314fabc5a3252a5a)
+++ src/ResolvExpr/ResolveAssertions.cc	(revision 2fd9f248cb5343ac6498428e655f30a1222c5ede)
@@ -189,14 +189,4 @@
 		assertf( candidate->get_uniqueId(), "Assertion candidate does not have a unique ID: %s", toString( candidate ).c_str() );
 
-		// everything with an empty idChain was pulled in by the current assertion.
-		// add current assertion's idChain + current assertion's ID so that the correct 
-		// inferParameters can be found.
-		for ( auto& a : match.need ) {
-			if ( a.second.idChain.empty() ) {
-				a.second.idChain = info.idChain;
-				a.second.idChain.push_back( decl->get_uniqueId() );
-			}
-		}
-
 		Expression* varExpr = match.cdata.combine( alt.cvtCost );
 		delete varExpr->result;
@@ -248,4 +238,10 @@
 			if ( unify( assn.decl->get_type(), adjType, newEnv, newNeed, have, newOpenVars, 
 					resn.indexer ) ) {
+				// set up idChain on new assertions
+				for ( auto& a : newNeed ) {
+					a.second.idChain = assn.info.idChain;
+					a.second.idChain.push_back( assn.decl->get_uniqueId() );
+				}
+
 				matches.emplace_back( cdata, adjType, std::move(newEnv), std::move(have), 
 					std::move(newNeed), std::move(newOpenVars) );
@@ -316,5 +312,4 @@
 						CandidateCost{resn.indexer} );
 					
-					// for ( auto& compat : compatible ) {
 					for ( auto it = compatible.begin(); it != lmin ; ++it ) {
 						auto& compat = *it;
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision fbecee54da078ee561a27cf4314fabc5a3252a5a)
+++ src/ResolvExpr/Resolver.cc	(revision 2fd9f248cb5343ac6498428e655f30a1222c5ede)
@@ -227,5 +227,5 @@
 				}
 
-				winners.emplace_back( candidates[i] );
+				winners.emplace_back( std::move( candidates[i] ) );
 			}
 
