Index: src/Common/PassVisitor.impl.h
===================================================================
--- src/Common/PassVisitor.impl.h	(revision a424315d713e9dbd8193a60186576d664fd6f5db)
+++ src/Common/PassVisitor.impl.h	(revision 0723a5716bac65785647f12737c8842ed6b525ca)
@@ -1018,10 +1018,42 @@
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( WaitForStmt * node ) {
-	VISIT_BODY( node );
+	VISIT_START( node );
+
+	for( auto & clause : node->clauses ) {
+		maybeAccept_impl( clause.target.function, *this );
+		maybeAccept_impl( clause.target.arguments, *this );
+
+		maybeAccept_impl( clause.statement, *this );
+		maybeAccept_impl( clause.condition, *this );
+	}
+
+	maybeAccept_impl( node->timeout.time, *this );
+	maybeAccept_impl( node->timeout.statement, *this );
+	maybeAccept_impl( node->timeout.condition, *this );
+	maybeAccept_impl( node->orelse.statement, *this );
+	maybeAccept_impl( node->orelse.condition, *this );
+
+	VISIT_END( node );
 }
 
 template< typename pass_type >
 Statement * PassVisitor< pass_type >::mutate( WaitForStmt * node ) {
-	MUTATE_BODY( Statement, node );
+	MUTATE_START( node );
+
+	for( auto & clause : node->clauses ) {
+		maybeMutate_impl( clause.target.function, *this );
+		maybeMutate_impl( clause.target.arguments, *this );
+
+		maybeMutate_impl( clause.statement, *this );
+		maybeMutate_impl( clause.condition, *this );
+	}
+
+	maybeMutate_impl( node->timeout.time, *this );
+	maybeMutate_impl( node->timeout.statement, *this );
+	maybeMutate_impl( node->timeout.condition, *this );
+	maybeMutate_impl( node->orelse.statement, *this );
+	maybeMutate_impl( node->orelse.condition, *this );
+
+	MUTATE_END( Statement, node );
 }
 
Index: src/GenPoly/Lvalue.cc
===================================================================
--- src/GenPoly/Lvalue.cc	(revision a424315d713e9dbd8193a60186576d664fd6f5db)
+++ src/GenPoly/Lvalue.cc	(revision 0723a5716bac65785647f12737c8842ed6b525ca)
@@ -465,4 +465,13 @@
 					return ret;
 				}
+			} else if ( CastExpr * castExpr = dynamic_cast< CastExpr * > ( arg ) ) {
+				// need to move cast to pointer type out a level since address of pointer
+				// is not valid C code (can be introduced in prior passes, e.g., InstantiateGeneric)
+				if ( InitTweak::getPointerBase( castExpr->result ) ) {
+					addrExpr->arg = castExpr->arg;
+					castExpr->arg = addrExpr;
+					castExpr->result = new PointerType( Type::Qualifiers(), castExpr->result );
+					return castExpr;
+				}
 			}
 			return addrExpr;
Index: src/main.cc
===================================================================
--- src/main.cc	(revision a424315d713e9dbd8193a60186576d664fd6f5db)
+++ src/main.cc	(revision 0723a5716bac65785647f12737c8842ed6b525ca)
@@ -80,4 +80,5 @@
 	exprp = false,
 	expraltp = false,
+	genericsp = false,
 	libcfap = false,
 	nopreludep = false,
@@ -320,7 +321,12 @@
 		OPTPRINT("instantiateGenerics")
 		GenPoly::instantiateGeneric( translationUnit );
+		if ( genericsp ) {
+			dump( translationUnit );
+			return 0;
+		}
 		OPTPRINT( "convertLvalue" )
 		GenPoly::convertLvalue( translationUnit );
 
+
 		if ( bboxp ) {
 			dump( translationUnit );
@@ -340,7 +346,9 @@
 
 		CodeTools::fillLocations( translationUnit );
+		OPTPRINT( "codegen" )
 		CodeGen::generate( translationUnit, *output, ! noprotop, prettycodegenp, true, linemarks );
 
 		CodeGen::FixMain::fix( *output, treep ? "../prelude/bootloader.c" : CFA_LIBDIR "/bootloader.c" );
+		OPTPRINT( "end" )
 
 		if ( output != &cout ) {
@@ -407,5 +415,5 @@
 
 	int c;
-	while ( (c = getopt_long( argc, argv, "abBcCdefglLmnNpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) {
+	while ( (c = getopt_long( argc, argv, "abBcCdefgGlLmnNpqrstTvyzZD:F:", long_opts, &long_index )) != -1 ) {
 		switch ( c ) {
 		  case Ast:
@@ -442,4 +450,7 @@
 		  case 'g':										// bison debugging info (grammar rules)
 			yydebug = true;
+			break;
+		  case 'G':                   // dump AST after instantiate generics
+			genericsp = true;
 			break;
 		  case LibCFA:
