Index: src/SynTree/ReferenceToType.cc
===================================================================
--- src/SynTree/ReferenceToType.cc	(revision 37a3b8f9cd78867281402907e903cddfd9b978a1)
+++ src/SynTree/ReferenceToType.cc	(revision ed94eac215a2568f1137e5c48ae381748645fef2)
@@ -59,5 +59,8 @@
 std::string StructInstType::typeString() const { return "struct"; }
 
-std::list<TypeDecl*>& StructInstType::get_baseParameters() { return baseStruct->get_parameters(); }
+std::list<TypeDecl*>* StructInstType::get_baseParameters() {
+	if ( ! baseStruct ) return NULL;
+	return &baseStruct->get_parameters();
+}
 
 void StructInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
@@ -68,5 +71,8 @@
 std::string UnionInstType::typeString() const { return "union"; }
 
-std::list<TypeDecl*>& UnionInstType::get_baseParameters() { return baseUnion->get_parameters(); }
+std::list<TypeDecl*>* UnionInstType::get_baseParameters() {
+	if ( ! baseUnion ) return NULL;
+	return &baseUnion->get_parameters();
+}
 
 void UnionInstType::lookup( const std::string &name, std::list< Declaration* > &foundDecls ) const {
Index: src/SynTree/Type.h
===================================================================
--- src/SynTree/Type.h	(revision 37a3b8f9cd78867281402907e903cddfd9b978a1)
+++ src/SynTree/Type.h	(revision ed94eac215a2568f1137e5c48ae381748645fef2)
@@ -238,6 +238,6 @@
 	void set_baseStruct( StructDecl *newValue ) { baseStruct = newValue; }
 
-	/// Accesses generic parameters of base struct
-	std::list<TypeDecl*>& get_baseParameters();
+	/// Accesses generic parameters of base struct (NULL if none such)
+	std::list<TypeDecl*>* get_baseParameters();
 	
 	/// Looks up the members of this struct named "name" and places them into "foundDecls".
@@ -265,6 +265,6 @@
 	void set_baseUnion( UnionDecl *newValue ) { baseUnion = newValue; }
 
-	/// Accesses generic parameters of base union
-	std::list<TypeDecl*>& get_baseParameters();
+	/// Accesses generic parameters of base union (NULL if none such)
+	std::list<TypeDecl*>* get_baseParameters();
 	
 	/// looks up the members of this union named "name" and places them into "foundDecls"
Index: src/SynTree/TypeSubstitution.cc
===================================================================
--- src/SynTree/TypeSubstitution.cc	(revision 37a3b8f9cd78867281402907e903cddfd9b978a1)
+++ src/SynTree/TypeSubstitution.cc	(revision ed94eac215a2568f1137e5c48ae381748645fef2)
@@ -147,7 +147,10 @@
 	} // if
 	// bind type variables from generic type instantiations
-	for ( std::list< TypeDecl* >::const_iterator tyvar = type->get_baseParameters().begin(); tyvar != type->get_baseParameters().end(); ++tyvar ) {
-		boundVars.insert( (*tyvar)->get_name() );
-	} // for
+	std::list< TypeDecl* > *baseParameters = type->get_baseParameters();
+	if ( baseParameters && ! type->get_parameters().empty() ) {
+		for ( std::list< TypeDecl* >::const_iterator tyvar = baseParameters->begin(); tyvar != baseParameters->end(); ++tyvar ) {
+			boundVars.insert( (*tyvar)->get_name() );
+		} // for
+	} // if
 	Type *ret = Mutator::mutate( type );
 	boundVars = oldBoundVars;
