Index: src/AST/Convert.hpp
===================================================================
--- src/AST/Convert.hpp	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/AST/Convert.hpp	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -20,5 +20,5 @@
 class Declaration;
 namespace ast {
-	struct TranslationUnit;
+	class TranslationUnit;
 };
 
Index: src/AST/Fwd.hpp
===================================================================
--- src/AST/Fwd.hpp	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/AST/Fwd.hpp	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -140,5 +140,5 @@
 typedef unsigned int UniqueId;
 
-struct TranslationUnit;
+class TranslationUnit;
 // TODO: Get from the TranslationUnit:
 extern ptr<Type> sizeType;
Index: src/AST/Pass.hpp
===================================================================
--- src/AST/Pass.hpp	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/AST/Pass.hpp	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -239,90 +239,32 @@
 private:
 
-	// Regular nodes
+	__pass::result1<ast::Stmt> call_accept( const ast::Stmt * );
+	__pass::result1<ast::Expr> call_accept( const ast::Expr * );
+
+	/// This has a `type` member that is the return type for the
+	/// generic call_accept if the generic call_accept is defined.
 	template< typename node_t >
-	struct result1 {
-		bool differs;
-		const node_t * value;
-
-		template< typename object_t, typename super_t, typename field_t >
-		void apply(object_t *, field_t super_t::* field);
-	};
-
-	result1<ast::Stmt> call_accept( const ast::Stmt * );
-	result1<ast::Expr> call_accept( const ast::Expr * );
+	using generic_call_accept_result =
+		std::enable_if<
+				!std::is_base_of<ast::Expr, node_t>::value &&
+				!std::is_base_of<ast::Stmt, node_t>::value
+			, __pass::result1<
+				typename std::remove_pointer< typename std::result_of<
+					decltype(&node_t::accept)(node_t*, type&) >::type >::type
+			>
+		>;
 
 	template< typename node_t >
 	auto call_accept( const node_t * node )
-		-> typename std::enable_if<
-				!std::is_base_of<ast::Expr, node_t>::value &&
-				!std::is_base_of<ast::Stmt, node_t>::value
-			, result1<
-				typename std::remove_pointer< decltype( node->accept(*this) ) >::type
-			>
-		>::type;
+		-> typename generic_call_accept_result<node_t>::type;
 
 	// requests WithStmtsToAdd directly add to this statement, as if it is a compound.
-	result1<ast::Stmt> call_accept_as_compound(const ast::Stmt *);
-
-	// Container of statements
+	__pass::result1<ast::Stmt> call_accept_as_compound(const ast::Stmt *);
+
 	template< template <class...> class container_t >
-	struct resultNstmt {
-		struct delta {
-			ptr<Stmt> nval;
-			ssize_t old_idx;
-			bool is_old;
-
-			delta(const Stmt * s, ssize_t i, bool old) : nval{s}, old_idx{i}, is_old{old} {}
-		};
-
-		bool differs;
-		container_t< delta > values;
-
-		resultNstmt() : differs(false), values{} {}
-		resultNstmt(bool diff, container_t< delta > && vals) : differs(diff), values(vals) {}
-
-		template< typename object_t, typename super_t, typename field_t >
-		void apply(object_t *, field_t super_t::* field);
-
-		template< template <class...> class incontainer_t >
-		void take_all( incontainer_t<ast::ptr<ast::Stmt>> * stmts ) {
-			if(!stmts || stmts->empty()) return;
-
-			std::transform(stmts->begin(), stmts->end(), std::back_inserter( values ), [](ast::ptr<ast::Stmt>& decl) -> delta {
-					return delta( decl.release(), -1, false );
-				});
-			stmts->clear();
-			differs = true;
-		}
-
-		template< template <class...> class incontainer_t >
-		void take_all( incontainer_t<ast::ptr<ast::Decl>> * decls ) {
-			if(!decls || decls->empty()) return;
-
-			std::transform(decls->begin(), decls->end(), std::back_inserter( values ), [](ast::ptr<ast::Decl>& decl) -> auto {
-					auto loc = decl->location;
-					auto stmt = new DeclStmt( loc, decl.release() );
-					return delta( stmt, -1, false );
-				});
-			decls->clear();
-			differs = true;
-		}
-	};
-
-	template< template <class...> class container_t >
-	resultNstmt<container_t> call_accept( const container_t< ptr<Stmt> > & );
-
-	// Container of something
+	__pass::resultNstmt<container_t> call_accept( const container_t< ptr<Stmt> > & );
+
 	template< template <class...> class container_t, typename node_t >
-	struct resultN {
-		bool differs;
-		container_t<ptr<node_t>> values;
-
-		template< typename object_t, typename super_t, typename field_t >
-		void apply(object_t *, field_t super_t::* field);
-	};
-
-	template< template <class...> class container_t, typename node_t >
-	resultN< container_t, node_t > call_accept( const container_t< ptr<node_t> > & container );
+	__pass::resultN< container_t, node_t > call_accept( const container_t< ptr<node_t> > & container );
 
 public:
Index: src/AST/Pass.impl.hpp
===================================================================
--- src/AST/Pass.impl.hpp	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/AST/Pass.impl.hpp	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -111,5 +111,4 @@
 		}
 
-
 		//------------------------------
 		/// Check if value was mutated, different for pointers and containers
@@ -125,9 +124,7 @@
 	}
 
-
-	template< typename core_t >
 	template< typename node_t >
 	template< typename object_t, typename super_t, typename field_t >
-	void ast::Pass< core_t >::result1< node_t >::apply(object_t * object, field_t super_t::* field) {
+	void __pass::result1< node_t >::apply( object_t * object, field_t super_t::* field ) {
 		object->*field = value;
 	}
@@ -136,11 +133,5 @@
 	template< typename node_t >
 	auto ast::Pass< core_t >::call_accept( const node_t * node )
-		-> typename std::enable_if<
-				!std::is_base_of<ast::Expr, node_t>::value &&
-				!std::is_base_of<ast::Stmt, node_t>::value
-			, ast::Pass< core_t >::result1<
-				typename std::remove_pointer< decltype( node->accept(*this) ) >::type
-			>
-		>::type
+		-> typename ast::Pass< core_t >::template generic_call_accept_result<node_t>::type
 	{
 		__pedantic_pass_assert( __visit_children() );
@@ -151,5 +142,5 @@
 
 		auto nval = node->accept( *this );
-		ast::Pass< core_t >::result1<
+		__pass::result1<
 			typename std::remove_pointer< decltype( node->accept(*this) ) >::type
 		> res;
@@ -160,5 +151,5 @@
 
 	template< typename core_t >
-	typename ast::Pass< core_t >::template result1<ast::Expr> ast::Pass< core_t >::call_accept( const ast::Expr * expr ) {
+	__pass::template result1<ast::Expr> ast::Pass< core_t >::call_accept( const ast::Expr * expr ) {
 		__pedantic_pass_assert( __visit_children() );
 		__pedantic_pass_assert( expr );
@@ -174,5 +165,5 @@
 
 	template< typename core_t >
-	typename ast::Pass< core_t >::template result1<ast::Stmt> ast::Pass< core_t >::call_accept( const ast::Stmt * stmt ) {
+	__pass::template result1<ast::Stmt> ast::Pass< core_t >::call_accept( const ast::Stmt * stmt ) {
 		__pedantic_pass_assert( __visit_children() );
 		__pedantic_pass_assert( stmt );
@@ -183,5 +174,5 @@
 
 	template< typename core_t >
-	typename ast::Pass< core_t >::template result1<ast::Stmt> ast::Pass< core_t >::call_accept_as_compound( const ast::Stmt * stmt ) {
+	__pass::template result1<ast::Stmt> ast::Pass< core_t >::call_accept_as_compound( const ast::Stmt * stmt ) {
 		__pedantic_pass_assert( __visit_children() );
 		__pedantic_pass_assert( stmt );
@@ -233,8 +224,7 @@
 	}
 
-	template< typename core_t >
 	template< template <class...> class container_t >
 	template< typename object_t, typename super_t, typename field_t >
-	void ast::Pass< core_t >::resultNstmt<container_t>::apply(object_t * object, field_t super_t::* field) {
+	void __pass::resultNstmt<container_t>::apply(object_t * object, field_t super_t::* field) {
 		auto & container = object->*field;
 		__pedantic_pass_assert( container.size() <= values.size() );
@@ -243,20 +233,48 @@
 
 		container_t<ptr<Stmt>> nvals;
-		for(delta & d : values) {
-			if( d.is_old ) {
+		for (delta & d : values) {
+			if ( d.is_old ) {
 				__pedantic_pass_assert( cit.idx <= d.old_idx );
 				std::advance( cit, d.old_idx - cit.idx );
 				nvals.push_back( std::move( (*cit).val) );
 			} else {
-				nvals.push_back( std::move(d.nval) );
+				nvals.push_back( std::move(d.new_val) );
 			}
 		}
 
-		object->*field = std::move(nvals);
+		container = std::move(nvals);
+	}
+
+	template< template <class...> class container_t >
+	template< template <class...> class incontainer_t >
+	void __pass::resultNstmt< container_t >::take_all( incontainer_t<ptr<Stmt>> * stmts ) {
+		if (!stmts || stmts->empty()) return;
+
+		std::transform(stmts->begin(), stmts->end(), std::back_inserter( values ),
+			[](ast::ptr<ast::Stmt>& stmt) -> delta {
+				return delta( stmt.release(), -1, false );
+			});
+		stmts->clear();
+		differs = true;
+	}
+
+	template< template<class...> class container_t >
+	template< template<class...> class incontainer_t >
+	void __pass::resultNstmt< container_t >::take_all( incontainer_t<ptr<Decl>> * decls ) {
+		if (!decls || decls->empty()) return;
+
+		std::transform(decls->begin(), decls->end(), std::back_inserter( values ),
+			[](ast::ptr<ast::Decl>& decl) -> delta {
+				auto loc = decl->location;
+				auto stmt = new DeclStmt( loc, decl.release() );
+				return delta( stmt, -1, false );
+			});
+		decls->clear();
+		differs = true;
 	}
 
 	template< typename core_t >
 	template< template <class...> class container_t >
-	typename ast::Pass< core_t >::template resultNstmt<container_t> ast::Pass< core_t >::call_accept( const container_t< ptr<Stmt> > & statements ) {
+	__pass::template resultNstmt<container_t> ast::Pass< core_t >::call_accept( const container_t< ptr<Stmt> > & statements ) {
 		__pedantic_pass_assert( __visit_children() );
 		if( statements.empty() ) return {};
@@ -285,5 +303,5 @@
 		pass_visitor_stats.avg->push(pass_visitor_stats.depth);
 
-		resultNstmt<container_t> new_kids;
+		__pass::resultNstmt<container_t> new_kids;
 		for( auto value : enumerate( statements ) ) {
 			try {
@@ -327,8 +345,7 @@
 	}
 
-	template< typename core_t >
 	template< template <class...> class container_t, typename node_t >
 	template< typename object_t, typename super_t, typename field_t >
-	void ast::Pass< core_t >::resultN<container_t, node_t>::apply(object_t * object, field_t super_t::* field) {
+	void __pass::resultN<container_t, node_t>::apply(object_t * object, field_t super_t::* field) {
 		auto & container = object->*field;
 		__pedantic_pass_assert( container.size() == values.size() );
@@ -346,5 +363,5 @@
 	template< typename core_t >
 	template< template <class...> class container_t, typename node_t >
-	typename ast::Pass< core_t >::template resultN<container_t, node_t> ast::Pass< core_t >::call_accept( const container_t< ast::ptr<node_t> > & container ) {
+	__pass::template resultN<container_t, node_t> ast::Pass< core_t >::call_accept( const container_t< ast::ptr<node_t> > & container ) {
 		__pedantic_pass_assert( __visit_children() );
 		if( container.empty() ) return {};
@@ -378,5 +395,5 @@
 		if ( ! errors.isEmpty() ) { throw errors; }
 
-		return ast::Pass< core_t >::resultN<container_t, node_t>{ mutated,  new_kids };
+		return ast::__pass::resultN<container_t, node_t>{ mutated, new_kids };
 	}
 
Index: src/AST/Pass.proto.hpp
===================================================================
--- src/AST/Pass.proto.hpp	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/AST/Pass.proto.hpp	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -23,5 +23,5 @@
 class Pass;
 
-struct TranslationUnit;
+class TranslationUnit;
 
 struct PureVisitor;
@@ -123,4 +123,50 @@
 		static constexpr bool value = std::is_void< ret_t >::value ||
 			std::is_base_of<const node_t, typename std::remove_pointer<ret_t>::type >::value;
+	};
+
+	/// The result is a single node.
+	template< typename node_t >
+	struct result1 {
+		bool differs;
+		const node_t * value;
+
+		template< typename object_t, typename super_t, typename field_t >
+		void apply( object_t *, field_t super_t::* field );
+	};
+
+	/// The result is a container of statements.
+	template< template<class...> class container_t >
+	struct resultNstmt {
+		/// The delta/change on a single node.
+		struct delta {
+			ptr<Stmt> new_val;
+			ssize_t old_idx;
+			bool is_old;
+
+			delta(const Stmt * s, ssize_t i, bool old) :
+				new_val(s), old_idx(i), is_old(old) {}
+		};
+
+		bool differs;
+		container_t< delta > values;
+
+		template< typename object_t, typename super_t, typename field_t >
+		void apply( object_t *, field_t super_t::* field );
+
+		template< template<class...> class incontainer_t >
+		void take_all( incontainer_t<ptr<Stmt>> * stmts );
+
+		template< template<class...> class incontainer_t >
+		void take_all( incontainer_t<ptr<Decl>> * decls );
+	};
+
+	/// The result is a container of nodes.
+	template< template<class...> class container_t, typename node_t >
+	struct resultN {
+		bool differs;
+		container_t<ptr<node_t>> values;
+
+		template< typename object_t, typename super_t, typename field_t >
+		void apply( object_t *, field_t super_t::* field );
 	};
 
Index: src/AST/TranslationUnit.hpp
===================================================================
--- src/AST/TranslationUnit.hpp	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/AST/TranslationUnit.hpp	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -23,5 +23,6 @@
 namespace ast {
 
-struct TranslationUnit {
+class TranslationUnit {
+public:
 	std::list< ptr< Decl > > decls;
 
Index: src/CodeGen/FixNames.h
===================================================================
--- src/CodeGen/FixNames.h	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/CodeGen/FixNames.h	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -20,5 +20,5 @@
 class Declaration;
 namespace ast {
-	struct TranslationUnit;
+	class TranslationUnit;
 }
 
Index: src/Common/CodeLocation.h
===================================================================
--- src/Common/CodeLocation.h	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/Common/CodeLocation.h	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -25,5 +25,4 @@
 	/// Create a new unset CodeLocation.
 	CodeLocation() = default;
-
 
 	/// Create a new CodeLocation with the given values.
Index: src/Common/CodeLocationTools.hpp
===================================================================
--- src/Common/CodeLocationTools.hpp	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/Common/CodeLocationTools.hpp	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -17,5 +17,5 @@
 
 namespace ast {
-	struct TranslationUnit;
+	class TranslationUnit;
 }
 
Index: src/Common/ResolvProtoDump.hpp
===================================================================
--- src/Common/ResolvProtoDump.hpp	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/Common/ResolvProtoDump.hpp	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -17,5 +17,5 @@
 
 namespace ast {
-	struct TranslationUnit;
+	class TranslationUnit;
 }
 
Index: src/Concurrency/Waitfor.cc
===================================================================
--- src/Concurrency/Waitfor.cc	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/Concurrency/Waitfor.cc	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -372,22 +372,6 @@
 			),
 			new ListInit(
-				map_range < std::list<Initializer*> > ( clause.target.arguments, [this](Expression * expr ){
-					Expression * init = new CastExpr(
-						new UntypedExpr(
-							new NameExpr( "get_monitor" ),
-							{ expr }
-						),
-						new PointerType(
-							noQualifiers,
-							new StructInstType(
-								noQualifiers,
-								decl_monitor
-							)
-						),
-						false
-					);
-
-					ResolvExpr::findSingleExpression( init, indexer );
-					return new SingleInit( init );
+				map_range < std::list<Initializer*> > ( clause.target.arguments, [](Expression * expr ){
+					return new SingleInit( expr );
 				})
 			)
Index: src/ControlStruct/MultiLevelExit.cpp
===================================================================
--- src/ControlStruct/MultiLevelExit.cpp	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/ControlStruct/MultiLevelExit.cpp	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -176,5 +176,5 @@
 	auto mutStmt = mutate( stmt );
 	// A child statement may set the break label.
-	mutStmt->kids = move( fixBlock( stmt->kids, false ) );
+	mutStmt->kids = fixBlock( stmt->kids, false );
 
 	if ( isLabeled ) {
Index: src/InitTweak/FixInit.h
===================================================================
--- src/InitTweak/FixInit.h	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/InitTweak/FixInit.h	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -21,5 +21,5 @@
 class Declaration;
 namespace ast {
-	struct TranslationUnit;
+	class TranslationUnit;
 }
 
Index: src/MakeLibCfa.h
===================================================================
--- src/MakeLibCfa.h	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/MakeLibCfa.h	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -5,5 +5,5 @@
 // file "LICENCE" distributed with Cforall.
 //
-// MakeLibCfa.h -- 
+// MakeLibCfa.h --
 //
 // Author           : Richard C. Bilson
@@ -20,5 +20,5 @@
 class Declaration;
 namespace ast {
-	struct TranslationUnit;
+	class TranslationUnit;
 }
 
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/ResolvExpr/Resolver.cc	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -1112,5 +1112,5 @@
 		}
 
-		
+
 	} // anonymous namespace
 /// Establish post-resolver invariants for expressions
@@ -1158,5 +1158,5 @@
 
 	namespace {
-		
+
 
 		/// resolve `untyped` to the expression whose candidate satisfies `pred` with the
@@ -1905,6 +1905,21 @@
 
 			clause2.target.args.reserve( clause.target.args.size() );
+			const ast::StructDecl * decl_monitor = symtab.lookupStruct( "monitor$" );
 			for ( auto arg : argsCandidates.front() ) {
-				clause2.target.args.emplace_back( std::move( arg->expr ) );
+				const auto & loc = stmt->location;
+
+				ast::Expr * init = new ast::CastExpr( loc,
+					new ast::UntypedExpr( loc,
+						new ast::NameExpr( loc, "get_monitor" ),
+						{ arg->expr }
+					),
+					new ast::PointerType(
+						new ast::StructInstType(
+							decl_monitor
+						)
+					)
+				);
+
+				clause2.target.args.emplace_back( findSingleExpression( init, symtab ) );
 			}
 
@@ -2077,5 +2092,5 @@
 		if (auto functionDecl = decl.as<ast::FunctionDecl>()) {
 			// xxx - can intrinsic gen ever fail?
-			if (functionDecl->linkage == ast::Linkage::AutoGen) { 
+			if (functionDecl->linkage == ast::Linkage::AutoGen) {
 				auto mutDecl = mutate(functionDecl);
 				mutDecl->isDeleted = true;
Index: src/ResolvExpr/Resolver.h
===================================================================
--- src/ResolvExpr/Resolver.h	(revision aac37fa530d851abe003e22cb465644dee20ff29)
+++ src/ResolvExpr/Resolver.h	(revision 7d187331ca6a29654c88d3046b52974ffe84c71d)
@@ -35,5 +35,5 @@
 	class StmtExpr;
 	class SymbolTable;
-	struct TranslationUnit;
+	class TranslationUnit;
 	class Type;
 	class TypeEnvironment;
@@ -72,5 +72,5 @@
 	ast::ptr< ast::Init > resolveCtorInit(
 		const ast::ConstructorInit * ctorInit, const ast::SymbolTable & symtab );
-	/// Resolves a statement expression 
+	/// Resolves a statement expression
 	const ast::Expr * resolveStmtExpr(
 		const ast::StmtExpr * stmtExpr, const ast::SymbolTable & symtab );
