diff --git a/ComputingTasks.cc b/ComputingTasks.cc
index 473087c00de06bfab494e4131ae68ae9afff49f1..a7cd3c7050b7a4d00e9087b12aaa75f8aacdce8a 100644
--- a/ComputingTasks.cc
+++ b/ComputingTasks.cc
@@ -165,7 +165,7 @@ StochSimulStatement::StochSimulStatement(const SymbolList &symbol_list_arg,
 void
 StochSimulStatement::checkPass(ModFileStructure &mod_file_struct)
 {
-  mod_file_struct.stoch_simul_or_similar_present = true;
+  mod_file_struct.stoch_simul_present = true;
 
   // Fill in option_order of mod_file_struct
   OptionsList::num_options_type::const_iterator it = options_list.num_options.find("order");
@@ -191,7 +191,7 @@ ForecastStatement::ForecastStatement(const SymbolList &symbol_list_arg,
 void
 ForecastStatement::checkPass(ModFileStructure &mod_file_struct)
 {
-  mod_file_struct.stoch_simul_or_similar_present = true;
+  mod_file_struct.forecast_present = true;
 
   // Fill in option_order of mod_file_struct
   OptionsList::num_options_type::const_iterator it = options_list.num_options.find("order");
@@ -217,7 +217,7 @@ RamseyPolicyStatement::RamseyPolicyStatement(const SymbolList &symbol_list_arg,
 void
 RamseyPolicyStatement::checkPass(ModFileStructure &mod_file_struct)
 {
-  mod_file_struct.stoch_simul_or_similar_present = true;
+  mod_file_struct.ramsey_policy_present = true;
 
   /* Fill in option_order of mod_file_struct
      Since ramsey policy needs one further order of derivation (for example, for 1st order
@@ -245,7 +245,7 @@ EstimationStatement::EstimationStatement(const SymbolList &symbol_list_arg,
 void
 EstimationStatement::checkPass(ModFileStructure &mod_file_struct)
 {
-  mod_file_struct.stoch_simul_or_similar_present = true;
+  mod_file_struct.estimation_present = true;
 
   // Fill in option_order of mod_file_struct
   OptionsList::num_options_type::const_iterator it = options_list.num_options.find("order");
@@ -718,7 +718,7 @@ OsrStatement::OsrStatement(const SymbolList &symbol_list_arg,
 void
 OsrStatement::checkPass(ModFileStructure &mod_file_struct)
 {
-  mod_file_struct.stoch_simul_or_similar_present = true;
+  mod_file_struct.osr_present = true;
 
   // Fill in option_order of mod_file_struct
   OptionsList::num_options_type::const_iterator it = options_list.num_options.find("order");
diff --git a/ModFile.cc b/ModFile.cc
index d90a704d7ced6a7ebe0824fce8748408891e49a0..38e10562dcbd66266294aa4a07614a8ba7d7f2e2 100644
--- a/ModFile.cc
+++ b/ModFile.cc
@@ -53,20 +53,32 @@ ModFile::checkPass()
   if (!mod_file_struct.order_option)
     mod_file_struct.order_option = 2;
 
+  bool stochastic_statement_present = mod_file_struct.stoch_simul_present
+    || mod_file_struct.estimation_present
+    || mod_file_struct.forecast_present
+    || mod_file_struct.osr_present
+    || mod_file_struct.ramsey_policy_present;
+
   // Allow empty model only when doing a standalone BVAR estimation
   if (model_tree.equation_number() == 0
       && (mod_file_struct.check_present
           || mod_file_struct.simul_present
-          || mod_file_struct.stoch_simul_or_similar_present))
+          || stochastic_statement_present))
+    {
+      cerr << "ERROR: At least one model equation must be declared!" << endl;
+      exit(-1);
+    }
+
+  if (mod_file_struct.simul_present && stochastic_statement_present)
     {
-      cerr << "Error: you must declare at least one model equation!" << endl;
+      cerr << "ERROR: A .mod file cannot contain both a simul command and one of {stoch_simul, estimation, forecast, osr, ramsey_policy}" << endl;
       exit(-1);
     }
 
-  if (mod_file_struct.simul_present
-      && mod_file_struct.stoch_simul_or_similar_present)
+  // Enforce the same number of equations and endogenous if ramsey_policy not present
+  if (!mod_file_struct.ramsey_policy_present && (model_tree.equation_number() != symbol_table.endo_nbr))
     {
-      cerr << "Error: a mod file cannot contain both a simul command and one of {stoch_simul, estimation, osr, ramsey_policy}" << endl;
+      cerr << "ERROR: There are " << model_tree.equation_number() << " equations but " << symbol_table.endo_nbr << " endogenous variables!" << endl;
       exit(-1);
     }
 }
@@ -114,14 +126,14 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all) const
       mOutputFile.open(fname.c_str(), ios::out | ios::binary);
       if (!mOutputFile.is_open())
         {
-          cerr << "Error: Can't open file " << fname
+          cerr << "ERROR: Can't open file " << fname
                << " for writing" << endl;
           exit(-1);
         }
     }
   else
     {
-      cerr << "Error: Missing file name" << endl;
+      cerr << "ERROR: Missing file name" << endl;
       exit(-1);
     }
 
diff --git a/Statement.cc b/Statement.cc
index dc629b49f2128c0ffac33a3fa3c0b6b007b01dd7..eff107c2b7681ecb8d81db1a1cf9202830c57bcd 100644
--- a/Statement.cc
+++ b/Statement.cc
@@ -22,7 +22,11 @@
 ModFileStructure::ModFileStructure() :
   check_present(false),
   simul_present(false),
-  stoch_simul_or_similar_present(false),
+  stoch_simul_present(false),
+  estimation_present(false),
+  forecast_present(false),
+  osr_present(false),
+  ramsey_policy_present(false),
   order_option(0)
 {
 }
diff --git a/include/ModFile.hh b/include/ModFile.hh
index aecd9c1ecbb4635dc70647ae86eee51099ea22ec..6dde1452291a0d6ec6d2c14e9083e24639c5ca42 100644
--- a/include/ModFile.hh
+++ b/include/ModFile.hh
@@ -60,6 +60,7 @@ public:
   //! Add a statement
   void addStatement(Statement *st);
   //! Do some checking and fills mod_file_struct
+  /*! \todo add check for number of equations and endogenous if ramsey_policy is present */
   void checkPass();
   //! Execute computations
   void computingPass();
diff --git a/include/Statement.hh b/include/Statement.hh
index 77dd87449da465d57c94237ff69b4cbd69147f4c..9a6f990a751d3efdf93d9fc60008c6e0a6729b26 100644
--- a/include/Statement.hh
+++ b/include/Statement.hh
@@ -36,9 +36,17 @@ public:
   bool check_present;
   //! Whether a simul statement is present
   bool simul_present;
-  //! Whether a stoch_simul, estimation, osr, ramsey_policy statement is present
-  bool stoch_simul_or_similar_present;
-  //! The value of the "order" option of stoch_simul, estimation, osr, ramsey_policy
+  //! Whether a stoch_simul statement is present
+  bool stoch_simul_present;
+  //! Whether an estimation statement is present
+  bool estimation_present;
+  //! Whether a forecast statement is present
+  bool forecast_present;
+  //! Whether an osr statement is present
+  bool osr_present;
+  //! Whether a ramsey_policy statement is present
+  bool ramsey_policy_present;
+  //! The value of the "order" option of stoch_simul, estimation, forecast, osr, ramsey_policy
   //! Derivation order
   /*! First initialized to zero. If user sets order option somewhere in the MOD file, it will be equal to the maximum of order options. Otherwise will default to 2 */
   int order_option;