Index: src/AST/Copy.hpp
===================================================================
--- src/AST/Copy.hpp	(revision bb9924c1b60075c589a791e23516d610a7027f04)
+++ src/AST/Copy.hpp	(revision f95634ee1f70e0dd4ea661aa832925cf8415519a)
@@ -88,4 +88,8 @@
 	}
 
+	void postvisit( const StmtExpr * node ) {
+		readonlyInsert( &node->resultExpr );
+	}
+
 	void postvisit( const MemberExpr * node ) {
 		readonlyInsert( &node->member );
@@ -122,5 +126,5 @@
 node_t * deepCopy( const node_t * localRoot ) {
 	Pass< DeepCopyCore > dc;
-	node_t const * newRoot = localRoot->accept( dc );
+	node_t const * newRoot = strict_dynamic_cast<node_t const*>(localRoot->accept( dc ));
 	dc.core.readonlyUpdates();
 	return const_cast< node_t * >( newRoot );
Index: src/AST/Expr.hpp
===================================================================
--- src/AST/Expr.hpp	(revision bb9924c1b60075c589a791e23516d610a7027f04)
+++ src/AST/Expr.hpp	(revision f95634ee1f70e0dd4ea661aa832925cf8415519a)
@@ -767,5 +767,6 @@
 
 /// An expression which must only be evaluated once
-class UniqueExpr final : public Expr {
+class 
+UniqueExpr final : public Expr {
 	static unsigned long long nextId;
 public:
