diff --git a/matlab/perfect-foresight-models/make_ex_.m b/matlab/perfect-foresight-models/make_ex_.m
index 4f72590484e4ee29f34fb652998f8c04792476ca..6bbb9659762e544e0c637609b67ea928f43dd020 100644
--- a/matlab/perfect-foresight-models/make_ex_.m
+++ b/matlab/perfect-foresight-models/make_ex_.m
@@ -42,7 +42,9 @@ end
 
 % Initialize oo_.exo_simul
 if isempty(M_.exo_histval)
-    if isempty(ex0_)
+    if options_.initval_file
+        % exo_simul provided by initval file
+    elseif isempty(ex0_)
         oo_.exo_simul = repmat(oo_.exo_steady_state',M_.maximum_lag+options_.periods+M_.maximum_lead,1);
     else
         oo_.exo_simul = [ repmat(ex0_',M_.maximum_lag,1) ; repmat(oo_.exo_steady_state',options_.periods+M_.maximum_lead,1) ];
diff --git a/matlab/perfect-foresight-models/perfect_foresight_setup.m b/matlab/perfect-foresight-models/perfect_foresight_setup.m
index 45f6f2789dbfa3ac032f57e09ad56e9b8a76eb32..8f59e4e9bafdbc7d9d9d6f3991a01af53ae6bade 100644
--- a/matlab/perfect-foresight-models/perfect_foresight_setup.m
+++ b/matlab/perfect-foresight-models/perfect_foresight_setup.m
@@ -64,7 +64,8 @@ if ~isempty(M_.det_shocks) && options_.periods<max([M_.det_shocks.periods])
     error('PERFECT_FORESIGHT_SETUP: Please check the declaration of the shocks or increase the value of the periods option.')
 end
 
+oo_ = make_ex_(M_,options_,oo_);
+
 if ~options_.initval_file
-    oo_ = make_ex_(M_,options_,oo_);
     oo_ = make_y_(M_,options_,oo_);
 end