diff --git a/matlab/dyn_ramsey_static.m b/matlab/dyn_ramsey_static.m
index 4750cd2c140289654748dff38efdc6b41dfa373b..2aef49901aa77180b35e18bc07c4a6d56ef72f82 100644
--- a/matlab/dyn_ramsey_static.m
+++ b/matlab/dyn_ramsey_static.m
@@ -47,23 +47,23 @@ if options_.steadystate_flag
     end
     ys = oo.steady_state;
     if inst_nbr == 1
-        inst_val = csolve(nl_func,oo_.steady_state(k_inst),'',options_.solve_tolf,100);
+        inst_val = csolve(nl_func,oo.steady_state(k_inst),'',options_.solve_tolf,100);
     else
         [inst_val,info1] = dynare_solve(nl_func,ys(k_inst),0);
     end
     ys(k_inst) = inst_val;
-    [x,params,check] = evaluate_steadystate_file(ys,exo_ss,params,M.fname,options_.steadystate_flag);
+    exo_ss = [oo.exo_steady_state oo.exo_det_steady_state];
+    [x,params,check] = evaluate_steady_state_file(ys,exo_ss,params,...
+                                                 M.fname,options_.steadystate_flag);
     if size(x,1) < M.endo_nbr 
         if length(M.aux_vars) > 0
             x =  feval([M.fname '_set_auxiliary_variables'],xx,...
-                       [oo.exo_steady_state,...
-                        oo.exo_det_steady_state],...
                        M.params);
         else
             error([M.fname '_steadystate.m doesn''t match the model']);
         end
     end
-    [junk,junk,multbar] = dyn_ramsey_static_1(x(k_inst),M,options_,oo_);
+    [junk,junk,multbar] = dyn_ramsey_static_1(x(k_inst),M,options_,oo);
     steady_state = [x(1:M.orig_endo_nbr); multbar];
 else
     xx = oo.steady_state(1:M.orig_endo_nbr);
@@ -106,10 +106,11 @@ if options_.steadystate_flag
                                    M.endo_names,'exact')];
     end
     oo.steady_state(k_inst) = x;
-    [x,check] = feval([M.fname '_steadystate'],...
-                      oo.steady_state,...
-                      [oo.exo_steady_state; ...
-                       oo.exo_det_steady_state]);
+    [x,params,check] = evaluate_steady_state_file(oo.steady_state,...
+                                                  [oo.exo_steady_state; ...
+                                                  oo.exo_det_steady_state] ...
+                                                  ,M.params,M.fname,...
+                                                  options_.steadystate_flag);
 end
 
 % setting steady state of auxiliary variables
diff --git a/preprocessor/SteadyStateModel.cc b/preprocessor/SteadyStateModel.cc
index c4b2cfd28fdf0da22682de8ac9a41cb7db30ea5d..f85aee07ca64d6b289626e457a91fb4dfa4326e0 100644
--- a/preprocessor/SteadyStateModel.cc
+++ b/preprocessor/SteadyStateModel.cc
@@ -116,8 +116,7 @@ SteadyStateModel::writeSteadyStateFile(const string &basename, bool ramsey_polic
   output << "function [ys_, params, info] = " << basename << "_steadystate2("
 	 << "ys_, exo_, params)" << endl
          << "% Steady state generated by Dynare preprocessor" << endl
-         << "    info = 0;" << endl
-	 << "    ys_ = zeros(" << symbol_table.endo_nbr() << ",1);" << endl;
+         << "    info = 0;" << endl;
 
   for (size_t i = 0; i < recursive_order.size(); i++)
     {