Index: src/Common/PassVisitor.h
===================================================================
--- src/Common/PassVisitor.h	(revision d24d4e166c6a6516f309efbac59c59da18c7169f)
+++ src/Common/PassVisitor.h	(revision 2a7b3ca400fe85559a7ebbd5d3b09859d5dfc4da)
@@ -12,4 +12,5 @@
 #include "SynTree/Expression.h"
 #include "SynTree/Constant.h"
+#include "SynTree/TypeSubstitution.h"
 
 #include "PassVisitor.proto.h"
Index: src/Common/PassVisitor.impl.h
===================================================================
--- src/Common/PassVisitor.impl.h	(revision d24d4e166c6a6516f309efbac59c59da18c7169f)
+++ src/Common/PassVisitor.impl.h	(revision 2a7b3ca400fe85559a7ebbd5d3b09859d5dfc4da)
@@ -105,4 +105,10 @@
 	SemanticError errors;
 
+	// don't want statements from outer CompoundStmts to be added to this CompoundStmt
+	ValueGuardPtr< StmtList_t > oldBeforeStmts( get_beforeStmts() );
+	ValueGuardPtr< StmtList_t > oldAfterStmts ( get_afterStmts () );
+	ValueGuardPtr< DeclList_t > oldBeforeDecls( get_beforeDecls() );
+	ValueGuardPtr< DeclList_t > oldAfterDecls ( get_afterDecls () );
+
 	StmtList_t* beforeStmts = get_beforeStmts();
 	StmtList_t* afterStmts  = get_afterStmts();
@@ -565,4 +571,7 @@
 	VISIT_START( node );
 
+	// maybeAccept( node->get_env(), *this );
+	maybeAccept( node->get_result(), *this );
+
 	for ( auto expr : node->get_args() ) {
 		visitExpression( expr );
@@ -575,4 +584,7 @@
 Expression * PassVisitor< pass_type >::mutate( UntypedExpr * node ) {
 	MUTATE_START( node );
+
+	node->set_env( maybeMutate( node->get_env(), *this ) );
+	node->set_result( maybeMutate( node->get_result(), *this ) );
 
 	for ( auto& expr : node->get_args() ) {
Index: src/Common/PassVisitor.proto.h
===================================================================
--- src/Common/PassVisitor.proto.h	(revision d24d4e166c6a6516f309efbac59c59da18c7169f)
+++ src/Common/PassVisitor.proto.h	(revision 2a7b3ca400fe85559a7ebbd5d3b09859d5dfc4da)
@@ -56,5 +56,5 @@
 // Deep magic (a.k.a template meta programming) to make the templated visitor work
 // Basically the goal is to make 2 previsit_impl
-// 1 - Use when a pass implements a valid previsit. This uses overloading which means the any overload of 
+// 1 - Use when a pass implements a valid previsit. This uses overloading which means the any overload of
 //     'pass.previsit( node )' that compiles will be used for that node for that type
 //     This requires that this option only compile for passes that actually define an appropriate visit.
