diff --git a/matlab/evaluate_smoother.m b/matlab/evaluate_smoother.m
index fa154df36b7017cd3ba5b61a3a5fc7df77b5a91e..3c2c84ed61a09caa347bb68c34a4bb8aa6d05460 100644
--- a/matlab/evaluate_smoother.m
+++ b/matlab/evaluate_smoother.m
@@ -86,9 +86,9 @@ if ischar(parameters)
     end
 end
 
-pshape_original   = bayestopt_.pshape;
-bayestopt_.pshape = Inf(size(bayestopt_.pshape));
-clear('priordens')
+%pshape_original   = bayestopt_.pshape;
+%bayestopt_.pshape = Inf(size(bayestopt_.pshape));
+%clear('priordens')
 
 [atT,innov,measurement_error,updated_variables,ys,trend_coeff,aK,T,R,P,PK,decomp] = ...
     DsgeSmoother(parameters,dataset_.info.ntobs,dataset_.data,dataset_.missing.aindex,dataset_.missing.state);
@@ -111,18 +111,17 @@ if options_.nk ~= 0
             decomp(options_.filter_step_ahead,i_endo,:,:);
     end
 end
-dr = oo_.dr;
-order_var = oo_.dr.order_var;
 for i=bayestopt_.smoother_saved_var_list'
     i1 = order_var(bayestopt_.smoother_var_list(i));
     eval(['oo.SmoothedVariables.' deblank(M_.endo_names(i1,:)) ' = atT(i,:)'';']);
-    eval(['oo.FilteredVariables.' deblank(M_.endo_names(i1,:)) ' = squeeze(aK(1,i,:));']);
+    if options_.nk>0
+        eval(['oo.FilteredVariables.' deblank(M_.endo_names(i1,:)) ' = squeeze(aK(1,i,:));']);
+    end
     eval(['oo.UpdatedVariables.' deblank(M_.endo_names(i1,:)) ' = updated_variables(i,:)'';']);
 end
 for i=1:M_.exo_nbr
     eval(['oo.SmoothedShocks.' deblank(M_.exo_names(i,:)) ' = innov(i,:)'';']);
 end
 
-oo.dr = oo_.dr;
-
-bayestopt_.pshape = pshape_original;
\ No newline at end of file
+%oo.dr = oo_.dr;
+%bayestopt_.pshape = pshape_original;
\ No newline at end of file
diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc
index 101d139bc4d850efd82724f0fe70603d599555aa..74e98e703febe82e1f07ee19d910142dea9799c7 100644
--- a/preprocessor/ComputingTasks.cc
+++ b/preprocessor/ComputingTasks.cc
@@ -2412,10 +2412,9 @@ CalibSmootherStatement::writeOutput(ostream &output, const string &basename) con
 {
   options_list.writeOutput(output);
   symbol_list.writeOutput("var_list_", output);
-  output << "options_.mode_compute = 0;" << endl
-         << "options_.smoother = 1;" << endl
-         << "options_.order = 1;" << endl
-         << "dynare_estimation(var_list_);" << endl;
+  output << "options_.smoother = 1;" << endl;
+  output << "options_.order = 1;" << endl;
+  output << "evaluate_smoother('calibration',var_list_);" << endl;
 }
 
 ExtendedPathStatement::ExtendedPathStatement(const OptionsList &options_list_arg)