diff --git a/matlab/disp_th_moments.m b/matlab/disp_th_moments.m
index 64ca5de32c8da6d2e5c40b0b562ca2060e4e8205..b40c41f9bfc4bc278354049b8b09df2284830bf5 100644
--- a/matlab/disp_th_moments.m
+++ b/matlab/disp_th_moments.m
@@ -37,9 +37,7 @@ end
 [oo_.gamma_y,stationary_vars] = th_autocovariances(dr,ivar,M_,options_);
 m = dr.ys(ivar);
 non_stationary_vars = setdiff(1:length(ivar),stationary_vars);
-ivar1 = intersect(non_stationary_vars,ivar);
-m(ivar1) = NaN;
-
+m(non_stationary_vars) = NaN;
 
 i1 = find(abs(diag(oo_.gamma_y{1})) > 1e-12);
 s2 = diag(oo_.gamma_y{1});
diff --git a/matlab/th_autocovariances.m b/matlab/th_autocovariances.m
index 4da9ca22a86be14a5fa8b783db700197575a33be..fa18783c8f5d05f277d5c08cc7b1b0f697d1f6b1 100644
--- a/matlab/th_autocovariances.m
+++ b/matlab/th_autocovariances.m
@@ -19,13 +19,12 @@ function [Gamma_y,stationary_vars] = th_autocovariances(dr,ivar,M_,options_,node
 %                                      Gamma_y{nar+2}   [double]  Variance decomposition.  
 %                                      Gamma_y{nar+3}   [double]  Expectation of the endogenous variables associated with a second 
 %                                                                 order approximation.    
-%   stationary_vars   [integer]      Vector of indices of stationary
-%                                           variables in declaration order
+%   stationary_vars   [integer]      Vector of indices of stationary variables (as a subset of 1:length(ivar))
 %
 % SPECIAL REQUIREMENTS
 %   
 
-% Copyright (C) 2001-2009 Dynare Team
+% Copyright (C) 2001-2010 Dynare Team
 %
 % This file is part of Dynare.
 %