diff --git a/matlab/ep/extended_path.m b/matlab/ep/extended_path.m
index c0bdaa3a614be67fa2fef33bd69164d64f0c2817..bcafdc2bc4c3ed8c25392611557a8f029968cbaf 100644
--- a/matlab/ep/extended_path.m
+++ b/matlab/ep/extended_path.m
@@ -350,4 +350,7 @@ end% (while) loop over t
 
 dyn_waitbar_close(hh);
 
-oo_.endo_simul = oo_.steady_state;
+if ~nargout
+    oo_.endo_simul = [initial_conditions, time_series];
+    dyn2vec;
+end
\ No newline at end of file
diff --git a/preprocessor/ComputingTasks.cc b/preprocessor/ComputingTasks.cc
index 36b1d456e5b82ce9c1e9fce9933bca9623d6f3c1..b56685497b02c2832f03961c34ac8d0244d1ce09 100644
--- a/preprocessor/ComputingTasks.cc
+++ b/preprocessor/ComputingTasks.cc
@@ -2477,8 +2477,8 @@ ExtendedPathStatement::writeOutput(ostream &output, const string &basename) cons
     if (it->first != string("periods"))
       output << "options_." << it->first << " = " << it->second << ";" << endl;
 
-  output << "oo_.endo_simul = [ oo_.steady_state, extended_path([], " << options_list.num_options.find("periods")->second
-         << ") ];" << endl
+  output << "extended_path([], " << options_list.num_options.find("periods")->second
+         << ");" << endl
          << "oo_.exo_simul = oo_.ep.shocks;" << endl;
 }