diff --git a/matlab/+mom/objective_function.m b/matlab/+mom/objective_function.m
index 6562f96628eab12bd9f6060ff7606018f2808314..1821cc566d56a5a142ed3b84fd95c4d7eb872ff8 100644
--- a/matlab/+mom/objective_function.m
+++ b/matlab/+mom/objective_function.m
@@ -221,14 +221,10 @@ if strcmp(options_mom_.mom.mom_method,'SMM')
     y_sim = simult_(M_, options_mom_, dr.ys, dr, scaled_shock_series, options_mom_.order);
     % provide meaningful penalty if data is nan or inf
     if any(any(isnan(y_sim))) || any(any(isinf(y_sim)))
-        if options_mom_.mom.vector_output == 1 % lsqnonlin requires vector output
-            fval = Inf(size(weighting_info.Sw,1),1);
-        else
-            fval = Inf;
-        end
         info(1)=180;
         info(4) = 0.1;
         exit_flag = 0;
+        fval = Inf;
         if options_mom_.mom.vector_output == 1 % lsqnonlin requires vector output
             fval = ones(options_mom_.mom.mom_nbr,1)*options_mom_.huge_number;
         end
@@ -272,21 +268,21 @@ if strcmp(options_mom_.mom.mom_method,'GMM') || strcmp(options_mom_.mom.mom_meth
     end
     if options_mom_.mom.compute_derivs && options_mom_.mom.analytic_jacobian
         if options_mom_.mom.penalized_estimator
-            dxparam1 = eye(length(xparam));
+            dxparam = eye(length(xparam));
         end
         for jp=1:length(xparam)
             dmoments_difference = - model_moments_params_derivs(:,jp);
             dresiduals = sqrt(options_mom_.mom.weighting_matrix_scaling_factor)*weighting_info.Sw*dmoments_difference;
             if options_mom_.mom.vector_output == 1 % lsqnonlin requires vector output
                 if options_mom_.mom.penalized_estimator
-                    df(:,jp)=[dresiduals;dxparam1(:,jp)./sqrt(diag(diag(bayestopt_.p2.^2)))];
+                    df(:,jp)=[dresiduals;dxparam(:,jp)./sqrt(diag(diag(bayestopt_.p2.^2)))];
                 else
                     df(:,jp) = dresiduals;
                 end
             else
                 df(jp,1) = dresiduals'*residuals + residuals'*dresiduals;
                 if options_mom_.mom.penalized_estimator
-                    df(jp,1)=df(jp,1)+(dxparam1(:,jp))'/(diag(bayestopt_.p2.^2))*(xparam-bayestopt_.p1)+(xparam-bayestopt_.p1)'/(diag(bayestopt_.p2.^2))*(dxparam1(:,jp));
+                    df(jp,1)=df(jp,1)+(dxparam(:,jp))'/(diag(bayestopt_.p2.^2))*(xparam-bayestopt_.p1)+(xparam-bayestopt_.p1)'/(diag(bayestopt_.p2.^2))*(dxparam(:,jp));
                 end
             end
         end
diff --git a/matlab/+mom/set_correct_bounds_for_stderr_corr.m b/matlab/+mom/set_correct_bounds_for_stderr_corr.m
index c8299c3cf70b9bf5b6af40b5ad65c139b283c178..3499cc399328e8fe683c603e85a5d9ce0b0c5ba8 100644
--- a/matlab/+mom/set_correct_bounds_for_stderr_corr.m
+++ b/matlab/+mom/set_correct_bounds_for_stderr_corr.m
@@ -8,7 +8,7 @@ function BoundsInfo = set_correct_bounds_for_stderr_corr(estim_params_,BoundsInf
 % o BoundsInfo    [struct] information on bounds
 % -------------------------------------------------------------------------
 % OUTPUT
-% o BoundsInfo    [struct] updated information on bounds
+% o BoundsInfo    [struct] updated bounds
 % -------------------------------------------------------------------------
 % This function is called by
 %  o mom.run
diff --git a/matlab/+mom/transform_prior_to_laplace_prior.m b/matlab/+mom/transform_prior_to_laplace_prior.m
index db6be256aa79204be81a66580d07965307cc9611..358f9fd1e64638339a5f8b1e43c4ea40a48a094b 100644
--- a/matlab/+mom/transform_prior_to_laplace_prior.m
+++ b/matlab/+mom/transform_prior_to_laplace_prior.m
@@ -1,10 +1,10 @@
 function bayestopt_ = transform_prior_to_laplace_prior(bayestopt_)
-% function bayestopt_ = transform_prior_to_laplace_prior(bayestopt_)
+% bayestopt_ = transform_prior_to_laplace_prior(bayestopt_)
 % -------------------------------------------------------------------------
 % Transforms the prior specification to a Laplace type of approximation:
 % only the prior mean and standard deviation are relevant, all other shape
 % information, except for the parameter bounds, is ignored.
-% =========================================================================
+% -------------------------------------------------------------------------
 % INPUTS
 % bayestopt_    [structure] prior information
 % -------------------------------------------------------------------------
@@ -32,7 +32,6 @@ function bayestopt_ = transform_prior_to_laplace_prior(bayestopt_)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <https://www.gnu.org/licenses/>.
 
-
 if any(setdiff([0;bayestopt_.pshape],[0,3]))
     fprintf('\nNon-normal priors specified. Penalized estimation uses a Laplace type of approximation:');
     fprintf('\nOnly the prior mean and standard deviation are relevant, all other shape information, except for the parameter bounds, is ignored.\n\n');
diff --git a/matlab/estimation/check_posterior_sampler_options.m b/matlab/estimation/check_posterior_sampler_options.m
index c0d4235ff1f22091c40ca8019036780afacbeb2d..29de7cf6891de044ffe52e957f037e37262597fa 100644
--- a/matlab/estimation/check_posterior_sampler_options.m
+++ b/matlab/estimation/check_posterior_sampler_options.m
@@ -311,7 +311,7 @@ if init
         end
 
         % slice posterior sampler does not require mode or hessian to run
-        % needs to be set to 1 to skip parts in dynare_estimation_1.m
+        % needs to be set to 1 to skip parts in dynare_estimation_1.m or mom.run.m
         % requiring posterior maximization/calibrated smoother before MCMC
         options_.mh_posterior_mode_estimation=true;
 
diff --git a/matlab/estimation/posterior_sampler.m b/matlab/estimation/posterior_sampler.m
index eb2b55ea8d47e1ab0ffdf5e246928174b9b6ba98..f1939042bacd97f2fa0f6b193cb22bad03d4d24a 100644
--- a/matlab/estimation/posterior_sampler.m
+++ b/matlab/estimation/posterior_sampler.m
@@ -10,8 +10,8 @@ function posterior_sampler(TargetFun,ProposalFun,xparam1,sampler_options,mh_boun
 %   o xparam1           [double]    (p*1) vector of parameters to be estimated (initial values).
 %   o sampler_options               structure
 %   o mh_bounds         [double]    (p*2) matrix defining lower and upper bounds for the parameters.
-%   o dataset_          [structure] data structure
-%   o dataset_info      [structure] dataset info structure
+%   o dataset_          [structure] data structure (likelihood-based) or data moments (method of moments)
+%   o dataset_info      [structure] dataset info structure (likelihood-based) or info on weighting matrix (method of moments)
 %   o options_          [structure] options structure
 %   o M_                [structure] model structure
 %   o estim_params_     [structure] estimated parameters structure
diff --git a/matlab/estimation/posterior_sampler_initialization.m b/matlab/estimation/posterior_sampler_initialization.m
index 1307588241be140b05f78e4b6e5494602ef4bce5..194f4c3c30f1401043e3157d734ecae1a143fd33 100644
--- a/matlab/estimation/posterior_sampler_initialization.m
+++ b/matlab/estimation/posterior_sampler_initialization.m
@@ -9,8 +9,8 @@ function [ ix2, ilogpo2, ModelName, MetropolisFolder, FirstBlock, FirstLine, npa
 %   o xparam1    [double]   (p*1) vector of parameters to be estimated (initial values).
 %   o vv         [double]   (p*p) matrix, posterior covariance matrix (at the mode).
 %   o mh_bounds  [double]   (p*2) matrix defining lower and upper bounds for the parameters.
-%   o dataset_              data structure
-%   o dataset_info          dataset info structure
+%   o dataset_              data structure (likelihood based) or data moments/irfs (method of moments)
+%   o dataset_info          dataset info structure (likelihood based) or info on weighting matrix (method of moments)
 %   o options_              options structure
 %   o M_                    model structure
 %   o estim_params_         estimated parameters structure
diff --git a/matlab/utilities/estimation/tune_mcmc_mh_jscale_wrapper.m b/matlab/utilities/estimation/tune_mcmc_mh_jscale_wrapper.m
index 0da796f513cd6ebbf74e77a49be771094ff4eb35..82548cd5841fe74447bf1e9ff66ce2daac983cfe 100644
--- a/matlab/utilities/estimation/tune_mcmc_mh_jscale_wrapper.m
+++ b/matlab/utilities/estimation/tune_mcmc_mh_jscale_wrapper.m
@@ -18,6 +18,7 @@ function mh_jscale = tune_mcmc_mh_jscale_wrapper(invhess, options_, M_, objectiv
 % -------------------------------------------------------------------------
 % This function is called by
 %  o dynare_estimation_1
+%  o mom.run
 % -------------------------------------------------------------------------
 
 % Copyright © 2023 Dynare Team