diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m
index 295d8ecfa745a18ff6f2e7f267492fd6b43aae97..6b6718ab419491566715de020fdce46d324a288b 100644
--- a/matlab/dynare_estimation_1.m
+++ b/matlab/dynare_estimation_1.m
@@ -346,6 +346,7 @@ if options_.mode_compute == 0 & length(options_.mode_file) == 0
         eval(['oo_.SmoothedShocks.' deblank(M_.exo_names(i,:)) ' = innov(i,:)'';']);
 	end
     end
+    save([M_.fname '_mode.mat'],'xparam1','hh','bayestopt_');
     return;
 end
 
@@ -424,7 +425,7 @@ if options_.mode_compute > 0 & options_.posterior_mode_estimation
         else
             [xparam1,hh,gg,fval,invhess] = newrat('DsgeVarLikelihood',xparam1,hh,gg,igg,crit,nit,flag,gend);
         end
-        save([M_.fname '_mode.mat'],'xparam1','hh','gg','fval','invhess');
+        save([M_.fname '_mode.mat'],'xparam1','hh','gg','fval','invhess','bayestopt_');
       case 6
         if ~options_.bvar_dsge
             fval = DsgeLikelihood(xparam1,gend,data,data_index,number_of_observations,no_more_missing_observations);
@@ -526,12 +527,9 @@ if options_.mode_compute > 0 & options_.posterior_mode_estimation
             else
                 hh = reshape(hessian('DsgeVarLikelihood',xparam1,options_.gstep,gend),nx,nx);
             end
-            save([M_.fname '_mode.mat'],'xparam1','hh','fval');
-        else
-            save([M_.fname '_mode.mat'],'xparam1','hh','fval');
         end
+        save([M_.fname '_mode.mat'],'xparam1','hh','bayestopt_');
     end
-    save([M_.fname '_mode.mat'],'xparam1','hh');
 end
 
 if options_.mode_check == 1 & options_.posterior_mode_estimation