diff --git a/src/ModFile.cc b/src/ModFile.cc
index 81f49912caf6ea5a84d710719dbc27813dc6b7a9..7d83522349ce0cd7badeab236e5fa2db5862ec25 100644
--- a/src/ModFile.cc
+++ b/src/ModFile.cc
@@ -366,12 +366,11 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
 {
   // Save the original model (must be done before any model transformations by preprocessor)
   // - except adl and diff which we always want expanded
+  dynamic_model.simplifyEquations();
   dynamic_model.substituteAdl();
   dynamic_model.setLeadsLagsOrig();
   original_model = dynamic_model;
 
-  dynamic_model.simplifyEquations();
-
   if (nostrict)
     {
       set<int> unusedEndogs = dynamic_model.findUnusedEndogenous();