diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc
index 8f098f08551223219a0b4e1e7620be0aaf235727..d4e715709fab5d5c5f5c1366d9099c5c1426759b 100644
--- a/preprocessor/ComputingTasks.cc
+++ b/preprocessor/ComputingTasks.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2017 Dynare Team
+ * Copyright (C) 2003-2019 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -663,6 +663,7 @@ DynareSensitivityStatement::checkPass(ModFileStructure &mod_file_struct, Warning
   if (it != options_list.num_options.end()
       && it->second == "1")
     mod_file_struct.identification_present = true;
+  mod_file_struct.sensitivity_present = true;
 }
 
 void
diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc
index 8983b5e6a799840150f30f0029c10f97790cccb1..044ebb5e4553f79a6a250cf85466840300c208e7 100644
--- a/preprocessor/ModFile.cc
+++ b/preprocessor/ModFile.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2017 Dynare Team
+ * Copyright (C) 2006-2019 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -129,7 +129,9 @@ ModFile::checkPass(bool nostrict)
     || mod_file_struct.osr_present
     || mod_file_struct.ramsey_policy_present
     || mod_file_struct.discretionary_policy_present
-    || mod_file_struct.calib_smoother_present;
+    || mod_file_struct.calib_smoother_present
+    || mod_file_struct.identification_present
+    || mod_file_struct.sensitivity_present;
 
   // Allow empty model only when doing a standalone BVAR estimation
   if (dynamic_model.equation_number() == 0
@@ -407,7 +409,9 @@ ModFile::transformPass(bool nostrict, bool compute_xrefs)
       || mod_file_struct.osr_present
       || mod_file_struct.ramsey_policy_present
       || mod_file_struct.discretionary_policy_present
-      || mod_file_struct.calib_smoother_present)
+      || mod_file_struct.calib_smoother_present
+      || mod_file_struct.identification_present
+      || mod_file_struct.sensitivity_present)
     {
       // In stochastic models, create auxiliary vars for leads and lags greater than 2, on both endos and exos
       dynamic_model.substituteEndoLeadGreaterThanTwo(false);
diff --git a/preprocessor/Statement.cc b/preprocessor/Statement.cc
index e1f9a01129d423536444c675f769d5624f6314e4..34077fa3f1978611fec607c0bb79c940290122cb 100644
--- a/preprocessor/Statement.cc
+++ b/preprocessor/Statement.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2017 Dynare Team
+ * Copyright (C) 2006-2019 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -38,6 +38,7 @@ ModFileStructure::ModFileStructure() :
   bvar_present(false),
   svar_identification_present(false),
   identification_present(false),
+  sensitivity_present(false),
   estimation_analytic_derivation(false),
   partial_information(false),
   k_order_solver(false),
diff --git a/preprocessor/Statement.hh b/preprocessor/Statement.hh
index 83dce960a4a65feb46c9814cf571f543b2035a76..f319256476c60aa2aca9dfdcc23c1ec24b262de8 100644
--- a/preprocessor/Statement.hh
+++ b/preprocessor/Statement.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2017 Dynare Team
+ * Copyright (C) 2006-2019 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -68,6 +68,8 @@ public:
   bool svar_identification_present;
   //! Whether an identification statement is present or the identification option of dynare_sensitivity statement is equal to one
   bool identification_present;
+  //! Whether a sensitivity statement is present
+  bool sensitivity_present;
   //! Whether the option analytic_derivation is given to estimation
   bool estimation_analytic_derivation;
   //! Whether the option partial_information is given to stoch_simul/estimation/osr/ramsey_policy