Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision e01559ccdf149d938faa048d3be60e6b7461bb1c)
+++ src/GenPoly/Box.cc	(revision e497c1de0c05bfb43de9bf1fa918f26ebf246013)
@@ -527,4 +527,5 @@
 
 		void Pass1::passAdapters( ApplicationExpr *appExpr, FunctionType *functionType, const TyVarMap &exprTyVars ) {
+			// collect a list of function types passed as parameters or implicit parameters (assertions)
 			std::list< DeclarationWithType *> &paramList = functionType->get_parameters();
 			std::list< FunctionType *> functions;
@@ -537,12 +538,25 @@
 				findFunction( (*arg)->get_type(), functions, exprTyVars, needsAdapter );
 			} // for
+
+			// parameter function types for which an appropriate adapter has been generated.
+			// we cannot use the types after applying substitutions, since two different 
+			// parameter types may be unified to the same type
 			std::set< std::string > adaptersDone;
+
 			for ( std::list< FunctionType *>::iterator funType = functions.begin(); funType != functions.end(); ++funType ) {
 				FunctionType *realFunction = (*funType)->clone();
-				assert( env );
-				env->apply( realFunction );
-
 				std::string mangleName = SymTab::Mangler::mangle( realFunction );
+
+				// only attempt to create an adapter or pass one as a parameter if we haven't 
+				// already done so for this pre-substitution parameter function type.
 				if ( adaptersDone.find( mangleName ) == adaptersDone.end() ) {
+					std::string mangleName = SymTab::Mangler::mangle( realFunction );
+					adaptersDone.insert( adaptersDone.begin(), mangleName );
+					
+					// apply substitution to type variables to figure out what the 
+					// adapter's type should look like
+					assert( env );
+					env->apply( realFunction );
+					mangleName = SymTab::Mangler::mangle( realFunction );
 					AdapterMap & adapters = Pass1::adapters.top();
 					AdapterMap::iterator adapter = adapters.find( mangleName );
@@ -555,4 +569,5 @@
 						continue;
 					} else if ( adapter == adapters.end() ) {
+						// adapter has not been created yet in the current scope, so define it
 						FunctionDecl *newAdapter = makeAdapter( *funType, realFunction, mangleName, exprTyVars );
 						adapter = adapters.insert( adapters.begin(), std::pair< std::string, FunctionDecl *>( mangleName, newAdapter ) );
@@ -560,7 +575,7 @@
 					} // if
 					assert( adapter != adapters.end() );
+
+					// add the appropriate adapter as a parameter
 					appExpr->get_args().push_front( new VariableExpr( adapter->second ) );
-					// appExpr->get_args().push_front( new NameExpr( makeAdapterName ( mangleName ) ) );
-					adaptersDone.insert( adaptersDone.begin(), mangleName );
 				} // if
 			} // for
@@ -880,4 +895,6 @@
 
 		void Pass1::doBeginScope() {
+			// actually, maybe this could (should?) push
+			// a copy of the current map
 			adapters.push(AdapterMap());
 		}
Index: src/main.cc
===================================================================
--- src/main.cc	(revision e01559ccdf149d938faa048d3be60e6b7461bb1c)
+++ src/main.cc	(revision e497c1de0c05bfb43de9bf1fa918f26ebf246013)
@@ -10,6 +10,6 @@
 // Created On       : Fri May 15 23:12:02 2015
 // Last Modified By : Rob Schluntz
-// Last Modified On : Wed Jul 15 16:45:24 2015
-// Update Count     : 145
+// Last Modified On : Tue Jul 28 13:05:02 2015
+// Update Count     : 165
 //
 
@@ -228,6 +228,4 @@
 		// add the assignment statement after the 
 		// initialization of a type parameter
-		OPTPRINT( "tweak" )
-		InitTweak::tweak( translationUnit );
 		OPTPRINT( "validate" )
 		SymTab::validate( translationUnit, symtabp );
@@ -251,4 +249,6 @@
 		OPTPRINT( "fixNames" ) 
 		CodeGen::fixNames( translationUnit );
+		OPTPRINT( "tweak" )
+		InitTweak::tweak( translationUnit );
 
 		if ( libcfap ) {
