diff --git a/matlab/check.m b/matlab/check.m
index 2ff30e0af925e0935994a4134c1b164a02e4d85b..f6a785aa429cb54bf9c1ab163e2678851c6c6800 100644
--- a/matlab/check.m
+++ b/matlab/check.m
@@ -1,4 +1,4 @@
-function [result,info] = check(M, options, oo)
+function [oo,result,info] = check(M, options, oo)
 % Checks determinacy conditions by computing the generalized eigenvalues.
 
 %@info:
@@ -21,6 +21,8 @@ function [result,info] = check(M, options, oo)
 %! @strong{Outputs}
 %! @sp 1
 %! @table @ @var
+%! @item oo
+%! Matlab's structure gathering the results (initialized by dynare).
 %! @item result
 %! Integer scalar equal to one (BK conditions are satisfied) or zero (otherwise).
 %! @item info
@@ -38,7 +40,7 @@ function [result,info] = check(M, options, oo)
 %! @end deftypefn
 %@eod:
 
-% Copyright (C) 2001-2012 Dynare Team
+% Copyright (C) 2001-2013 Dynare Team
 %
 % This file is part of Dynare.
 %
diff --git a/matlab/smm_objective.m b/matlab/smm_objective.m
index 8067463696c02172bdfe7646280a6b5b01995f83..24adb3c63ec2bcecb1eb4741e9b0b062e46bab69 100644
--- a/matlab/smm_objective.m
+++ b/matlab/smm_objective.m
@@ -15,7 +15,7 @@ function [r,flag] = smm_objective(xparams,sample_moments,weighting_matrix,option
 % SPECIAL REQUIREMENTS
 %  The user has to provide a file where the moment conditions are defined.
 
-% Copyright (C) 2010-2012 Dynare Team
+% Copyright (C) 2010-2013 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -75,7 +75,7 @@ save('estimated_parameters.mat','xparams');
 
 % Check for local determinacy of the deterministic steady state.
 noprint = options_.noprint; options_.noprint = 1;
-[local_determinacy_and_stability,info] = check(M_,options_,oo_); options_.noprint = noprint;
+[oo_,local_determinacy_and_stability,info] = check(M_,options_,oo_); options_.noprint = noprint;
 if ~local_determinacy_and_stability
     r = priorObjectiveValue * (1+info(2));
     flag = 0;
diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc
index cc755332570290282abdc1f7a351fa11f5ed08b4..4dbdc4ef798e19ef0c3056b1f1eeac505df10ecb 100644
--- a/preprocessor/ComputingTasks.cc
+++ b/preprocessor/ComputingTasks.cc
@@ -59,7 +59,7 @@ void
 CheckStatement::writeOutput(ostream &output, const string &basename) const
 {
   options_list.writeOutput(output);
-  output << "check(M_,options_,oo_);\n";
+  output << "oo_ = check(M_,options_,oo_);" << endl;
 }
 
 void