diff --git a/matlab/@dprior/admissible.m b/matlab/@dprior/admissible.m
index c3a46c36b530869d61968a2e878a60382dbcc1c2..82cce25f3ef61198f7d6dee7ecd6acd9d44d991f 100644
--- a/matlab/@dprior/admissible.m
+++ b/matlab/@dprior/admissible.m
@@ -133,7 +133,7 @@ try
     for i = 1:ndraws
         draw = o.draw();
         if ~o.admissible(draw)
-            error()
+            error('problem in admissible')
         end
     end
     t(1) = true;
diff --git a/matlab/distributions/mode_and_variance_to_mean.m b/matlab/distributions/mode_and_variance_to_mean.m
index e4a892829bb2d50eb8d7270a3e22c3d837fafcdf..1d7f6729ab015f009b1ecadcf881e8e6cc6baa1d 100644
--- a/matlab/distributions/mode_and_variance_to_mean.m
+++ b/matlab/distributions/mode_and_variance_to_mean.m
@@ -177,8 +177,7 @@ if (distribution==4)% Beta distribution
     if length(idx)>1
         error('Multiplicity of solutions for the beta distribution specification.')
     elseif isempty(idx)
-        disp('No solution for the beta distribution specification. You should reduce the variance.')
-        error();
+        error('No solution for the beta distribution specification. You should reduce the variance.')
     end
     alpha = real_roots(idx);
     beta = ((1-m)*alpha+2*m-1)/m;
diff --git a/matlab/estimation/dsge_simulated_theoretical_correlation.m b/matlab/estimation/dsge_simulated_theoretical_correlation.m
index 5d2ed379d42a871f0049e17c43cdec37a5608424..d874cb54ba08fc185ebb176db849ec2b86259604 100644
--- a/matlab/estimation/dsge_simulated_theoretical_correlation.m
+++ b/matlab/estimation/dsge_simulated_theoretical_correlation.m
@@ -44,6 +44,5 @@ if strcmpi(type,'posterior')
 elseif strcmpi(type,'prior')
     CorrFileNumber = length(dir([M_.dname '/prior/moments/' M_.fname '_PriorCorrelations*']));
 else
-    disp('dsge_simulated_theoretical_correlation:: Unknown type!');
-    error()
+    error('dsge_simulated_theoretical_correlation:: Unknown type!');
 end
diff --git a/matlab/estimation/dsge_simulated_theoretical_covariance.m b/matlab/estimation/dsge_simulated_theoretical_covariance.m
index 62cbcabd495687e8b2b7955427d882c84e3d27c8..31d5a1486d1bde18d5a08919e70948af9db42303 100644
--- a/matlab/estimation/dsge_simulated_theoretical_covariance.m
+++ b/matlab/estimation/dsge_simulated_theoretical_covariance.m
@@ -44,8 +44,7 @@ elseif strcmpi(type,'prior')
     CheckPath('prior/moments',M_.dname);
     posterior = 0;
 else
-    disp('dsge_simulated_theoretical_covariance:: Unknown type!')
-    error();
+    error('dsge_simulated_theoretical_covariance:: Unknown type!')
 end
 
 %delete old stale files before creating new ones
diff --git a/matlab/estimation/dsge_simulated_theoretical_variance_decomposition.m b/matlab/estimation/dsge_simulated_theoretical_variance_decomposition.m
index 57e6508cdb4faa1b90a5f8238effcab843f0d707..880b27438fd24c358c264befc21dd5e356e41381 100644
--- a/matlab/estimation/dsge_simulated_theoretical_variance_decomposition.m
+++ b/matlab/estimation/dsge_simulated_theoretical_variance_decomposition.m
@@ -46,8 +46,7 @@ elseif strcmpi(type,'prior')
     CheckPath('prior/moments',M_.dname);
     posterior = 0;
 else
-    disp('dsge_simulated_theoretical_variance_decomposition:: Unknown type!')
-    error()
+    error('dsge_simulated_theoretical_variance_decomposition:: Unknown type!')
 end
 
 %delete old stale files before creating new ones
diff --git a/matlab/stochastic_solver/simultxdet.m b/matlab/stochastic_solver/simultxdet.m
index b5aee2536d985565c7f44842e2968c864fba5cd6..55806e2c1de143446c16cbfec65761387c1b327b 100644
--- a/matlab/stochastic_solver/simultxdet.m
+++ b/matlab/stochastic_solver/simultxdet.m
@@ -9,14 +9,18 @@ function [y_,int_width,int_width_ME]=simultxdet(y0,ex,ex_det, iorder,var_list,M_
 %    ex_det:    matrix of deterministic exogenous shocks, starting at period 1-M_.maximum_lag
 %    iorder:    order of approximation
 %    var_list:  list of endogenous variables to simulate
-%   int_width_ME:distance between upper bound and
-%                mean forecast when considering measurement error
+%    M_:        Dynare model structure
+%    oo_:       Dynare results structure
+%    options_:  Dynare options structure
+%
 % OUTPUTS:
 %   yf:          mean forecast
 %   int_width:   distance between upper bound and
 %                mean forecast
 %   int_width_ME:distance between upper bound and
 %                mean forecast when considering measurement error
+%   int_width_ME:distance between upper bound and
+%                mean forecast when considering measurement error
 %
 % The forecast horizon is equal to size(ex, 1).
 % The condition size(ex,1)+M_.maximum_lag=size(ex_det,1) must be verified
@@ -118,6 +122,8 @@ elseif iorder == 2
         end
         k1 = k1+1;
     end
+else
+    error('simultxdet.m: order>2 not supported.')
 end
 
 [A,B] = kalman_transition_matrix(dr,nstatic+(1:nspred),1:nc);
@@ -132,7 +138,7 @@ sigma_y = 0;
 
 var_yf=NaN(iter,nvar); %initialize
 for i=1:iter
-    sigma_y1 = ghx1*sigma_y*ghx1'+sigma_u1;
+    sigma_y1 = ghx1*sigma_y*ghx1'+sigma_u1; %only valid at first order, needs to be fixed, see https://git.dynare.org/Dynare/dynare/-/issues/1940
     var_yf(i,:) = diag(sigma_y1)';
     if i == iter
         break
diff --git a/tests/write/example1.mod b/tests/write/example1.mod
index 8ba9f85a37ec9ea1c49e252757f1a8877e820d81..889dd5e30d2db684f1de20c9272a55a6c4abf83c 100644
--- a/tests/write/example1.mod
+++ b/tests/write/example1.mod
@@ -84,6 +84,6 @@ end;
 
 verbatim;
   if ~isequal(M_.observed_exo_names, {'ey'; 'ex'})
-    error()
+    error('Arguments are not identical')
   end
 end;