diff --git a/matlab/model_diagnostics.m b/matlab/model_diagnostics.m
index 92122514f145d69ce8774803cb1af13c5cdaa40d..29b56b318f8f83f31ec7e8c524b28efdf29b67e0 100644
--- a/matlab/model_diagnostics.m
+++ b/matlab/model_diagnostics.m
@@ -63,6 +63,12 @@ if M.exo_nbr == 0
     oo.exo_steady_state = [] ;
 end
 
+
+info=test_for_deep_parameters_calibration(M);
+if info
+    problem_dummy=1;
+end;
+
 % check if ys is steady state
 options.debug=1; %locally set debug option to 1
 [dr.ys,params,check1]=evaluate_steady_state(oo.steady_state,M,options,oo,1);
diff --git a/matlab/test_for_deep_parameters_calibration.m b/matlab/test_for_deep_parameters_calibration.m
index 0f5ab7aecfebd9b4cef89db1808a2c5c9aba97d0..c5b88b40fb1790852aba625f8ef772a5ffe908b7 100644
--- a/matlab/test_for_deep_parameters_calibration.m
+++ b/matlab/test_for_deep_parameters_calibration.m
@@ -1,11 +1,11 @@
-function test_for_deep_parameters_calibration(M_)
+function info=test_for_deep_parameters_calibration(M_)
 % Issues a warning is some of the parameters are NaNs.
 %
 % INPUTS
 %   M_    [structure]   Description of the (simulated or estimated) model.
 %  
 % OUTPUTS
-%   none
+%   info  [scalar]      0 if no problems detected, 1 otherwise 
 %    
 % ALGORITHM
 %   none
@@ -13,7 +13,7 @@ function test_for_deep_parameters_calibration(M_)
 % SPECIAL REQUIREMENTS
 %   none
 
-% Copyright (C) 2010 Dynare Team
+% Copyright (C) 2010-2014 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -31,6 +31,7 @@ function test_for_deep_parameters_calibration(M_)
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.    
 plist = list_of_parameters_calibrated_as_NaN(M_);
 if ~isempty(plist)
+    info=1;
     message = ['Some of the parameters have no value (' ];
     for i=1:size(plist,1)
         if i<size(plist,1)
@@ -47,4 +48,6 @@ if ~isempty(plist)
     if strmatch('optimal_policy_discount_factor',plist,'exact')
         warning('Either you have not correctly initialized planner_discount or you are calling a command like steady or stoch_simul that is not allowed in the context of ramsey_policy')
     end
+else
+    info=0;
 end
\ No newline at end of file