Index: src/InitTweak/InitTweak.cc
===================================================================
--- src/InitTweak/InitTweak.cc	(revision 6f096d2341e25591a9d9435e4a28725954748a7a)
+++ src/InitTweak/InitTweak.cc	(revision fd642d2c3aee132ffbce05c2d7092e4dac7fa8d0)
@@ -9,7 +9,7 @@
 // Author           : Rob Schluntz
 // Created On       : Fri May 13 11:26:36 2016
-// Last Modified By : Aaron B. Moss
-// Last Modified On : Mon Jun 10 13:30:00 2019
-// Update Count     : 5
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Jun 19 14:34:00 2019
+// Update Count     : 6
 //
 
@@ -633,13 +633,21 @@
 			return nullptr;
 		}
+
+		DeclarationWithType * getFunctionCore( const Expression * expr ) {
+			if ( const auto * appExpr = dynamic_cast< const ApplicationExpr * >( expr ) ) {
+				return getCalledFunction( appExpr->function );
+			} else if ( const auto * untyped = dynamic_cast< const UntypedExpr * >( expr ) ) {
+				return getCalledFunction( untyped->function );
+			}
+			assertf( false, "getFunction with unknown expression: %s", toString( expr ).c_str() );
+		}
 	}
 
 	DeclarationWithType * getFunction( Expression * expr ) {
-		if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr ) ) {
-			return getCalledFunction( appExpr->get_function() );
-		} else if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * > ( expr ) ) {
-			return getCalledFunction( untyped->get_function() );
-		}
-		assertf( false, "getFunction received unknown expression: %s", toString( expr ).c_str() );
+		return getFunctionCore( expr );
+	}
+
+	const DeclarationWithType * getFunction( const Expression * expr ) {
+		return getFunctionCore( expr );
 	}
 
Index: src/InitTweak/InitTweak.h
===================================================================
--- src/InitTweak/InitTweak.h	(revision 6f096d2341e25591a9d9435e4a28725954748a7a)
+++ src/InitTweak/InitTweak.h	(revision fd642d2c3aee132ffbce05c2d7092e4dac7fa8d0)
@@ -9,7 +9,7 @@
 // Author           : Rob Schluntz
 // Created On       : Fri May 13 11:26:36 2016
-// Last Modified By : Aaron B. Moss
-// Last Modified On : Mon Jun 10 13:30:00 2019
-// Update Count     : 5
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Jul 19 14:18:00 2019
+// Update Count     : 6
 //
 
@@ -61,4 +61,5 @@
 	/// returns the declaration of the function called by the expr (must be ApplicationExpr or UntypedExpr)
 	DeclarationWithType * getFunction( Expression * expr );
+	const DeclarationWithType * getFunction( const Expression * expr );
 	const ast::DeclWithType * getFunction( const ast::Expr * expr );
 
