Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 0b00df0b8a3e78119f146bb3d5894465fb9f24d4)
+++ src/GenPoly/Box.cc	(revision a200795e703916156fb98c276dcb4da596a519bd)
@@ -657,10 +657,10 @@
 				paramExpr = new AddressExpr( paramExpr );
 			} // if
-			arg = appExpr->get_args().insert( arg, paramExpr ); // add argument to function call
+			arg = appExpr->args.insert( arg, paramExpr ); // add argument to function call
 			arg++;
 			// Build a comma expression to call the function and emulate a normal return.
 			CommaExpr *commaExpr = new CommaExpr( appExpr, retExpr );
-			commaExpr->set_env( appExpr->get_env() );
-			appExpr->set_env( 0 );
+			commaExpr->env = appExpr->env;
+			appExpr->env = nullptr;
 			return commaExpr;
 		}
@@ -708,5 +708,5 @@
 //			if ( ! function->get_returnVals().empty() && isPolyType( function->get_returnVals().front()->get_type(), tyVars ) ) {
 			if ( isDynRet( function, tyVars ) ) {
-				ret = addRetParam( appExpr, function->get_returnVals().front()->get_type(), arg );
+				ret = addRetParam( appExpr, function->returnVals.front()->get_type(), arg );
 			} // if
 			std::string mangleName = mangleAdapterName( function, tyVars );
@@ -715,5 +715,5 @@
 			// cast adaptee to void (*)(), since it may have any type inside a polymorphic function
 			Type * adapteeType = new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) );
-			appExpr->get_args().push_front( new CastExpr( appExpr->get_function(), adapteeType ) );
+			appExpr->get_args().push_front( new CastExpr( appExpr->function, adapteeType ) );
 			appExpr->set_function( new NameExpr( adapterName ) ); // xxx - result is never set on NameExpr
 
@@ -1764,7 +1764,7 @@
 
 		Expression *PolyGenericCalculator::postmutate( SizeofExpr *sizeofExpr ) {
-			Type *ty = sizeofExpr->get_isType() ? 
+			Type *ty = sizeofExpr->get_isType() ?
 				sizeofExpr->get_type() : sizeofExpr->get_expr()->get_result();
-			
+
 			Expression * gen = genSizeof( ty );
 			if ( gen ) {
Index: src/GenPoly/GenPoly.cc
===================================================================
--- src/GenPoly/GenPoly.cc	(revision 0b00df0b8a3e78119f146bb3d5894465fb9f24d4)
+++ src/GenPoly/GenPoly.cc	(revision a200795e703916156fb98c276dcb4da596a519bd)
@@ -459,6 +459,5 @@
 
 	void addToTyVarMap( TypeDecl * tyVar, TyVarMap &tyVarMap ) {
-		// xxx - should this actually be insert?
-		tyVarMap[ tyVar->get_name() ] = TypeDecl::Data{ tyVar };
+		tyVarMap.insert( tyVar->name, TypeDecl::Data{ tyVar } );
 	}
 
Index: src/GenPoly/Lvalue.cc
===================================================================
--- src/GenPoly/Lvalue.cc	(revision 0b00df0b8a3e78119f146bb3d5894465fb9f24d4)
+++ src/GenPoly/Lvalue.cc	(revision a200795e703916156fb98c276dcb4da596a519bd)
@@ -21,9 +21,9 @@
 #include "Lvalue.h"
 
+#include "InitTweak/InitTweak.h"
 #include "Parser/LinkageSpec.h"          // for Spec, isBuiltin, Intrinsic
 #include "ResolvExpr/TypeEnvironment.h"  // for AssertionSet, OpenVarSet
 #include "ResolvExpr/Unify.h"            // for unify
 #include "ResolvExpr/typeops.h"
-#include "SymTab/Autogen.h"
 #include "SymTab/Indexer.h"              // for Indexer
 #include "SynTree/Declaration.h"         // for Declaration, FunctionDecl
@@ -33,4 +33,5 @@
 #include "SynTree/Type.h"                // for PointerType, Type, FunctionType
 #include "SynTree/Visitor.h"             // for Visitor, acceptAll
+#include "Validate/FindSpecialDecls.h"   // for dereferenceOperator
 
 #if 0
@@ -44,7 +45,7 @@
 		// TODO: fold this into the general createDeref function??
 		Expression * mkDeref( Expression * arg ) {
-			if ( SymTab::dereferenceOperator ) {
+			if ( Validate::dereferenceOperator ) {
 				// note: reference depth can be arbitrarily deep here, so peel off the outermost pointer/reference, not just pointer because they are effecitvely equivalent in this pass
-				VariableExpr * deref = new VariableExpr( SymTab::dereferenceOperator );
+				VariableExpr * deref = new VariableExpr( Validate::dereferenceOperator );
 				deref->result = new PointerType( Type::Qualifiers(), deref->result );
 				Type * base = InitTweak::getPointerBase( arg->result );
@@ -353,4 +354,6 @@
 			Type * destType = castExpr->result;
 			Type * srcType = castExpr->arg->result;
+			assertf( destType, "Cast to no type in: %s", toCString( castExpr ) );
+			assertf( srcType, "Cast from no type in: %s", toCString( castExpr ) );
 			int depth1 = destType->referenceDepth();
 			int depth2 = srcType->referenceDepth();
Index: src/GenPoly/ScopedSet.h
===================================================================
--- src/GenPoly/ScopedSet.h	(revision 0b00df0b8a3e78119f146bb3d5894465fb9f24d4)
+++ src/GenPoly/ScopedSet.h	(revision a200795e703916156fb98c276dcb4da596a519bd)
@@ -38,5 +38,5 @@
 		typedef typename Scope::pointer pointer;
 		typedef typename Scope::const_pointer const_pointer;
-		
+
 		class iterator : public std::iterator< std::bidirectional_iterator_tag,
 		                                       value_type > {
@@ -72,5 +72,5 @@
 				return *this;
 			}
-			
+
 			reference operator* () { return *it; }
 			pointer operator-> () { return it.operator->(); }
@@ -104,4 +104,6 @@
 			bool operator!= (const iterator &that) { return !( *this == that ); }
 
+			size_type get_level() const { return i; }
+
 		private:
 			scope_list const *scopes;
@@ -180,4 +182,6 @@
 			bool operator!= (const const_iterator &that) { return !( *this == that ); }
 
+			size_type get_level() const { return i; }
+
 		private:
 			scope_list const *scopes;
@@ -185,5 +189,5 @@
 			size_type i;
 		};
-		
+
 		/// Starts a new scope
 		void beginScope() {
@@ -222,5 +226,5 @@
 			return const_iterator( const_cast< ScopedSet< Value >* >(this)->find( key ) );
 		}
-		
+
 		/// Finds the given key in the outermost scope inside the given scope where it occurs
 		iterator findNext( const_iterator &it, const Value &key ) {
@@ -242,5 +246,5 @@
 			return std::make_pair( iterator(scopes, res.first, scopes.size()-1), res.second );
 		}
-		
+
 	};
 } // namespace GenPoly
