diff --git a/DynamicModel.cc b/DynamicModel.cc
index 266987d5dfafb01c0f862427426cfd64dd4fb935..fc5164ef3b002888abef119da871a1d9572afa2d 100644
--- a/DynamicModel.cc
+++ b/DynamicModel.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2016 Dynare Team
+ * Copyright (C) 2003-2017 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -2345,11 +2345,12 @@ DynamicModel::writeDynamicModel(ostream &DynamicOutput, bool use_dll, bool julia
     {
       // Check that we don't have more than 32 nested parenthesis because Matlab does not suppor this. See Issue #1201
       map<string, string> tmp_paren_vars;
-      fixNestedParenthesis(model_output, tmp_paren_vars);
-      fixNestedParenthesis(model_local_vars_output, tmp_paren_vars);
-      fixNestedParenthesis(jacobian_output, tmp_paren_vars);
-      fixNestedParenthesis(hessian_output, tmp_paren_vars);
-      fixNestedParenthesis(third_derivatives_output, tmp_paren_vars);
+      bool message_printed = false;
+      fixNestedParenthesis(model_output, tmp_paren_vars, message_printed);
+      fixNestedParenthesis(model_local_vars_output, tmp_paren_vars, message_printed);
+      fixNestedParenthesis(jacobian_output, tmp_paren_vars, message_printed);
+      fixNestedParenthesis(hessian_output, tmp_paren_vars, message_printed);
+      fixNestedParenthesis(third_derivatives_output, tmp_paren_vars, message_printed);
 
       DynamicOutput << "%" << endl
                     << "% Model equations" << endl
diff --git a/ModelTree.cc b/ModelTree.cc
index a1c4f6a81b74816bbb16ce85c16b462498c325e9..70db28e01f05e404a6d20c577ecc0144d16b9a00 100644
--- a/ModelTree.cc
+++ b/ModelTree.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2016 Dynare Team
+ * Copyright (C) 2003-2017 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -1293,7 +1293,7 @@ ModelTree::writeTemporaryTerms(const temporary_terms_t &tt, const temporary_term
 }
 
 void
-ModelTree::fixNestedParenthesis(ostringstream &output, map<string, string> &tmp_paren_vars) const
+ModelTree::fixNestedParenthesis(ostringstream &output, map<string, string> &tmp_paren_vars, bool &message_printed) const
 {
   string str = output.str();
   if (!testNestedParenthesis(str))
@@ -1323,12 +1323,15 @@ ModelTree::fixNestedParenthesis(ostringstream &output, map<string, string> &tmp_
 
       if (hit_limit && open == 0)
         {
-          cerr << "Warning: A .m file created by Dynare will have more than 32 nested parenthesis. Matlab cannot support this. " << endl
-               << "         We are going to modify, albeit inefficiently, this output to have fewer than 32 nested parenthesis. " << endl
-               << "         It would hence behoove you to use the use_dll option of the model block to circumnavigate this problem." << endl
-               << "         If you have not yet set up a compiler on your system, see the Matlab documentation for doing so." << endl
-               << "         For Windows, see: https://www.mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html" << endl << endl;
-
+          if (!message_printed)
+            {
+              cerr << "Warning: A .m file created by Dynare will have more than 32 nested parenthesis. Matlab cannot support this. " << endl
+                   << "         We are going to modify, albeit inefficiently, this output to have fewer than 32 nested parenthesis. " << endl
+                   << "         It would hence behoove you to use the use_dll option of the model block to circumnavigate this problem." << endl
+                   << "         If you have not yet set up a compiler on your system, see the Matlab documentation for doing so." << endl
+                   << "         For Windows, see: https://www.mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html" << endl << endl;
+              message_printed = true;
+            }
           string str1 = str.substr(first_open_paren, matching_paren - first_open_paren + 1);
           string repstr = "";
           string varname;
diff --git a/ModelTree.hh b/ModelTree.hh
index db014bc2f8d56d087d148c67570afc6b2235cbcd..9b28fce461a70060511cea90e0ec88a41b96fda9 100644
--- a/ModelTree.hh
+++ b/ModelTree.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2016 Dynare Team
+ * Copyright (C) 2003-2017 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -191,7 +191,7 @@ protected:
   //! Adds informations for simulation in a binary file
   void Write_Inf_To_Bin_File(const string &basename, int &u_count_int, bool &file_open, bool is_two_boundaries, int block_mfs) const;
   //! Fixes output when there are more than 32 nested parens, Issue #1201
-  void fixNestedParenthesis(ostringstream &output, map<string, string> &tmp_paren_vars) const;
+  void fixNestedParenthesis(ostringstream &output, map<string, string> &tmp_paren_vars, bool &message_printed) const;
   //! Tests if string contains more than 32 nested parens, Issue #1201
   bool testNestedParenthesis(const string &str) const;
   //! Writes model local variables
diff --git a/StaticModel.cc b/StaticModel.cc
index 0428d08299bbaf00b7a466e0e2179c6c2bb0079d..f02ef83cccc74a0a8f01baec4ac76b893b37e5cb 100644
--- a/StaticModel.cc
+++ b/StaticModel.cc
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2003-2016 Dynare Team
+ * Copyright (C) 2003-2017 Dynare Team
  *
  * This file is part of Dynare.
  *
@@ -1400,11 +1400,12 @@ StaticModel::writeStaticModel(ostream &StaticOutput, bool use_dll, bool julia) c
     {
       // Check that we don't have more than 32 nested parenthesis because Matlab does not suppor this. See Issue #1201
       map<string, string> tmp_paren_vars;
-      fixNestedParenthesis(model_output, tmp_paren_vars);
-      fixNestedParenthesis(model_local_vars_output, tmp_paren_vars);
-      fixNestedParenthesis(jacobian_output, tmp_paren_vars);
-      fixNestedParenthesis(hessian_output, tmp_paren_vars);
-      fixNestedParenthesis(third_derivatives_output, tmp_paren_vars);
+      bool message_printed = false;
+      fixNestedParenthesis(model_output, tmp_paren_vars, message_printed);
+      fixNestedParenthesis(model_local_vars_output, tmp_paren_vars, message_printed);
+      fixNestedParenthesis(jacobian_output, tmp_paren_vars, message_printed);
+      fixNestedParenthesis(hessian_output, tmp_paren_vars, message_printed);
+      fixNestedParenthesis(third_derivatives_output, tmp_paren_vars, message_printed);
 
       StaticOutput << "residual = zeros( " << equations.size() << ", 1);" << endl << endl
                    << "%" << endl