diff --git a/doc/manual/source/installation-and-configuration.rst b/doc/manual/source/installation-and-configuration.rst
index 844084545609bbac002a39f76b8c0d5af1a33026..5117d1e23cd85b8651eca784bd55cce145c5211a 100644
--- a/doc/manual/source/installation-and-configuration.rst
+++ b/doc/manual/source/installation-and-configuration.rst
@@ -100,6 +100,18 @@ Debian, Ubuntu and Linux Mint).
 On macOS
 --------
 
+.. warning::
+
+   Installing into ``/Applications/dynare`` might fail if you have older versions of Dynare already installed in ``/Applications/Dynare``.
+   To fix this, modify the ownership by executing the following command in Terminal.app::
+
+     sudo chown -R "$USER":staff /Applications/Dynare
+
+   Alternatively, you can modify the installation path in the automated installed using *Customize* and *Location*.
+   After installation, the folder will contain several sub-directories, among which are ``matlab``, ``mex``, and ``doc``.
+   Several versions of Dynare can coexist (by default in ``/Applications/Dynare``),
+   as long as you correctly adjust your path settings (see :ref:`words-warning`).
+
 With MATLAB
 ^^^^^^^^^^^
 
@@ -109,15 +121,6 @@ and follow the instructions.
 This installation does not require administrative privileges.
 If for some reason admin rights are requested, use *Change Install Location* and select *Install for me only*.
 The default installation directory is ``/Applications/Dynare/x.y-arch``.
-Installing into ``/Applications/dynare`` might fail if you have older versions of Dynare already installed in ``/Applications/Dynare``.
-To fix this, modify the ownership by executing the following command in Terminal.app::
-
-  sudo chown -R "$USER":staff /Applications/Dynare
-
-Alternatively, you can modify the installation path in the automated installed using *Customize* and *Location*.
-After installation, the folder will contain several sub-directories, among which are ``matlab``, ``mex``, and ``doc``.
-Several versions of Dynare can coexist (by default in ``/Applications/Dynare``),
-as long as you correctly adjust your path settings (see :ref:`words-warning`).
 
 It is recommended to install the Xcode Command Line Tools (this is an Apple product)
 and GCC via Homebrew_ (see :ref:`prerequisites-macos`).
@@ -142,6 +145,8 @@ once)::
 
   octave:1> pkg install -forge io statistics control struct optim
 
+If you want to use the `x13` functionality of `dseries`, you also need to build the `x13as` binary. [#fx13]_
+
 On FreeBSD
 ----------
 
@@ -334,3 +339,8 @@ Dynare unusable.
 .. _Dynare wiki: https://git.dynare.org/Dynare/dynare/wikis
 .. _Octave-Forge: https://octave.sourceforge.io/
 .. _Homebrew: https://brew.sh
+
+
+.. rubric:: Footnotes
+
+.. [#fx13] See the instructions at `<https://forum.dynare.org/t/missing-installation-package/27350/4>`__.
\ No newline at end of file
diff --git a/doc/manual/source/the-model-file.rst b/doc/manual/source/the-model-file.rst
index 8be7dda09c6c6deb447bf1897c950506dcefdf2e..c52076ca1de0df9e6a6f536c10e10cf6d4f127a4 100644
--- a/doc/manual/source/the-model-file.rst
+++ b/doc/manual/source/the-model-file.rst
@@ -4015,7 +4015,7 @@ speed-up on large models.
        shooting and relaxation approaches. Note that round off errors
        are more important with this mixed strategy (user should check
        the reported value of the maximum absolute error). Only
-       available with option ``stack_solve_algo==0``.
+       available with ``stack_solve_algo`` option equal to ``0``.
 
 
     .. option:: linear_approximation
@@ -4024,8 +4024,8 @@ speed-up on large models.
        model. The model must be stationary and a steady state 
        needs to be provided. Linearization is conducted about the 
        last defined steady state, which can derive from ``initval``,
-       ``endval`` or a subsequent ``steady``. Only available with option
-       ``stack_solve_algo==0`` or ``stack_solve_algo==7``.
+       ``endval`` or a subsequent ``steady``. Only available with
+       ``stack_solve_algo`` option equal to ``0`` or ``7``.
 
     .. option:: steady_solve_algo = INTEGER
 
diff --git a/matlab/perfect-foresight-models/perfect_foresight_solver_core.m b/matlab/perfect-foresight-models/perfect_foresight_solver_core.m
index 05d20af691ee238380d258fadd288023224694f5..c561e59be8cf1c12dd5e8f293221b9ab1f57d010 100644
--- a/matlab/perfect-foresight-models/perfect_foresight_solver_core.m
+++ b/matlab/perfect-foresight-models/perfect_foresight_solver_core.m
@@ -17,7 +17,7 @@ function [y, success, maxerror, iter, per_block_status] = perfect_foresight_solv
 % - iter                [integer] Number of iterations of the underlying nonlinear solver (empty for non-iterative methods)
 % - per_block_status    [struct] In the case of block decomposition, provides per-block solver status information (empty if no block decomposition)
 
-% Copyright © 2015-2024 Dynare Team
+% Copyright © 2015-2025 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -43,15 +43,39 @@ end
 
 periods = get_simulation_periods(options_);
 
-if options_.linear_approximation && ~(isequal(options_.stack_solve_algo,0) || isequal(options_.stack_solve_algo,7))
-    error('perfect_foresight_solver: Option linear_approximation is only available with option stack_solve_algo equal to 0 or 7.')
+if options_.linear_approximation
+    if ~ismember(options_.stack_solve_algo, [0 7])
+        error('perfect_foresight_solver: option linear_approximation is only available with stack_solve_algo option equal to 0 or 7')
+    end
+    if options_.block
+        error('perfect_foresight_solver: option linear_approximation is not available with the block option')
+    end
+    if options_.bytecode
+        error('perfect_foresight_solver: option linear_approximation is not available with the bytecode option')
+    end
+    if M_.maximum_endo_lead == 0 || M_.maximum_endo_lag == 0
+        error('perfect_foresight_solver: option linear_approximation is not available with purely backward, purely forward or static models')
+    end
 end
 
-if options_.endogenous_terminal_period && options_.stack_solve_algo ~= 0
-    error('perfect_foresight_solver: option endogenous_terminal_period is only available with option stack_solve_algo equal to 0')
+if options_.endogenous_terminal_period
+    if options_.stack_solve_algo ~= 0
+        error('perfect_foresight_solver: option endogenous_terminal_period is only available with stack_solve_algo option equal to 0')
+    end
+    if options_.block
+        error('perfect_foresight_solver: option endogenous_terminal_period is not available with the block option')
+    end
+    if options_.bytecode
+        error('perfect_foresight_solver: option endogenous_terminal_period is not available with the bytecode option')
+    end
+    if M_.maximum_endo_lead == 0 || M_.maximum_endo_lag == 0
+        error('perfect_foresight_solver: option endogenous_terminal_period is not available with purely backward, purely forward or static models')
+    end
 end
 
-if options_.linear && (isequal(options_.stack_solve_algo, 0) || isequal(options_.stack_solve_algo, 7))
+
+if options_.linear && ismember(options_.stack_solve_algo, [0 7]) && ~options_.block ...
+        && ~options_.bytecode && M_.maximum_endo_lead > 0 && M_.maximum_endo_lag > 0
     options_.linear_approximation = true;
 end
 
@@ -98,22 +122,16 @@ else
             switch options_.stack_solve_algo
               case {0 2 3}
                 if options_.linear_approximation
-                    if ismember(options_.stack_solve_algo, [2 3])
-                        error('Invalid value of stack_solve_algo option!')
-                    end
                     [y, success, maxerror] = sim1_linear(y, exo_simul, steady_state, exo_steady_state, M_, options_);
                 else
                     [y, success, maxerror, iter] = sim1(y, exo_simul, steady_state, M_, options_);
                 end
               case {1 6}
-                if options_.linear_approximation
-                    error('Invalid value of stack_solve_algo option!')
-                end
                 [y, success, maxerror, iter] = sim1_lbj(y, exo_simul, steady_state, M_, options_);
               case 7
                 if options_.linear_approximation
                     if options_.solve_algo == 10 || options_.solve_algo == 11
-                        warning('Since you are requesting an MCP solver, you should not specify your model as model(linear)!')
+                        warning('Since you are requesting an MCP solver, you should not specify your model as model(linear) or use the linear_approximation option!')
                     end
                     [y, success] = solve_stacked_linear_problem(y, exo_simul, steady_state, exo_steady_state, M_, options_);
                 else