diff --git a/matlab/CutSample.m b/matlab/CutSample.m
index bfbfeeed92861b851c7508c317d6465d3f81c329..845bed8b814744445f07c34e3df6c36fe7bb3333 100644
--- a/matlab/CutSample.m
+++ b/matlab/CutSample.m
@@ -31,8 +31,6 @@ function CutSample(M_, options_, estim_params_)
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-global M_ options_ estim_params_
-
 npar = estim_params_.np+estim_params_.nvn+estim_params_.ncx+estim_params_.ncn+estim_params_.nvx;
 
 DirectoryName = CheckPath('metropolis');
diff --git a/matlab/GetPosteriorParametersStatistics.m b/matlab/GetPosteriorParametersStatistics.m
index 7f6abec491de8d53664d82a682e475f47d906d70..a0bec03f9739b67478d55efe22b23c5f1907adef 100644
--- a/matlab/GetPosteriorParametersStatistics.m
+++ b/matlab/GetPosteriorParametersStatistics.m
@@ -32,8 +32,6 @@ function oo_ = GetPosteriorParametersStatistics(estim_params_, M_, options_, bay
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-global estim_params_ M_ options_ bayestopt_ oo_
-
 %if ~options_.mh_replic & options_.load_mh_file
 %   load([M_.fname '_results.mat'],'oo_'); 
 %end
diff --git a/matlab/PlotPosteriorDistributions.m b/matlab/PlotPosteriorDistributions.m
index 1d1cac5e59a4fb42d512d5929bffab4858fcd373..190aaccf5df29a2d83721780cc2f562b3c536bdc 100644
--- a/matlab/PlotPosteriorDistributions.m
+++ b/matlab/PlotPosteriorDistributions.m
@@ -33,8 +33,6 @@ function oo_ = PlotPosteriorDistributions(estim_params_, M_, options_, bayestopt
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-global estim_params_ M_ options_ bayestopt_ oo_
-
 OutputDirectoryName = CheckPath('Output');
 
 TeX   	= options_.TeX;
diff --git a/matlab/dynare_estimation.m b/matlab/dynare_estimation.m
index 4018782e161f407e0034c7ee95feb054bd7a7e96..1ed04fa0de4c718ca4244c38e301776576334e67 100644
--- a/matlab/dynare_estimation.m
+++ b/matlab/dynare_estimation.m
@@ -924,7 +924,7 @@ if (any(bayestopt_.pshape  >0 ) & options_.mh_replic) | ...
       McMCDiagnostics(options_, estim_params_, M_);
   end
   %% Here i discard first half of the draws:
-  CutSample;
+  CutSample(M_, options_, estim_params_);
   %% Estimation of the marginal density from the Mh draws:
   if options_.mh_replic
       [marginal,oo_] = marginal_density(M_, options_, estim_params_, oo_);