diff --git a/matlab/ep/extended_path.m b/matlab/ep/extended_path.m
index 92f5623f431154d54b8895233aaa6b8d11df62cb..f7035080e5ef28754461a90102e319d89b4b8c7e 100644
--- a/matlab/ep/extended_path.m
+++ b/matlab/ep/extended_path.m
@@ -31,11 +31,9 @@ function time_series = extended_path(initial_conditions,sample_size)
 % 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_ oo_
-    
-memory = 0;
-debug = 0;
+
 options_.verbosity = options_.ep.verbosity;
-verbosity = options_.ep.verbosity+debug;
+verbosity = options_.ep.verbosity+options_.ep.debug;
 
 % Test if bytecode and block options are used (these options are mandatory)
 if ~( options_.bytecode && options_.block )
@@ -159,7 +157,7 @@ t  = 0;
 hh = dyn_waitbar(0,'Please wait. Extended Path simulations...');
 set(hh,'Name','EP simulations.');
 
-if memory
+if options_.ep.memory
     mArray1 = zeros(M_.endo_nbr,100,nnn,sample_size);
     mArray2 = zeros(M_.exo_nbr,100,nnn,sample_size);
 end
@@ -308,7 +306,7 @@ while (t<sample_size)
             oo_.endo_simul = tmp;
         end
         % Save results of the perfect foresight model solver.
-        if memory
+        if options_.ep.memory
             mArray1(:,:,s,t) = oo_.endo_simul(:,1:100);
             mArrat2(:,:,s,t) = transpose(oo_.exo_simul(1:100,:));            
         end
@@ -327,6 +325,6 @@ dyn_waitbar_close(hh);
 
 oo_.endo_simul = oo_.steady_state;
 
-if memory
-    save([M_.fname '_memory'],'mArray1','mArray2','www');
+if options_.ep.memory
+    save([M_.fname '_options_.ep.memory'],'mArray1','mArray2','www');
 end
\ No newline at end of file
diff --git a/matlab/global_initialization.m b/matlab/global_initialization.m
index a11067a7703c2fceb84ec0a91c523be65f8b0bae..544902faa10809b6298e889be3dccd5cb072e52b 100644
--- a/matlab/global_initialization.m
+++ b/matlab/global_initialization.m
@@ -109,6 +109,10 @@ options_.SpectralDensity = 0;
 
 % Extended path options
 %
+% Set debug flag
+ep.debug = 0;
+% Set memory flag
+ep.memory = 0;
 % Set verbose mode
 ep.verbosity = 0;
 % Initialization of the perfect foresight equilibrium paths