diff --git a/tests/bgp/fs2000/fs2000.mod b/tests/bgp/fs2000/fs2000.mod
index e5ef2fc4994806565f29838bd906f637db6a9d84..4a6da499da949b4f234e69ea926937c4ad56bf3f 100644
--- a/tests/bgp/fs2000/fs2000.mod
+++ b/tests/bgp/fs2000/fs2000.mod
@@ -62,10 +62,19 @@ end;
 verbatim;
 
     bgp.write(M_);
-    options = optimoptions('fsolve','Display','iter','Algorithm','levenberg-marquardt','MaxFunctionEvaluations',1000000,'MaxIterations',100000,'SpecifyObjectiveGradient',true,'FunctionTolerance',1e-6,'StepTolerance',1e-6);
-    y = 1+(rand(M_.endo_nbr,1)-.5)*.5;
+    y = 1+(rand(M_.endo_nbr,1)-.5)*.25;
     g = ones(M_.endo_nbr,1);% 1+(rand(M_.endo_nbr,1)-.5)*.1;
-    [y, fval, exitflag] = fsolve(@fs2000.bgpfun, [y;g], options);
+    if ~isoctave
+        options = optimoptions('fsolve','Display','iter','Algorithm','levenberg-marquardt','MaxFunctionEvaluations',1000000,'MaxIterations',100000,'SpecifyObjectiveGradient',true,'FunctionTolerance',1e-6,'StepTolerance',1e-6);
+        [y, fval, exitflag] = fsolve(@fs2000.bgpfun, [y;g], options);
+    else
+        options = optimset('Display','iter','Algorithm','levenberg-marquardt','MaxFunEvals',1000000,'MaxIter',100000,'GradObj','on','TolFun',1e-6,'TolX',1e-6);
+        h=str2func('fs2000.bgpfun'); %workaround for https://savannah.gnu.org/bugs/?46659 still present in Octave 5
+        [y, fval, exitflag] = fsolve(h, [y;g], options);
+    end
+    if exitflag<1
+        error('Solution not found')
+    end
     y(1:M_.orig_endo_nbr)
     y(M_.endo_nbr+(1:M_.orig_endo_nbr))
 
diff --git a/tests/bgp/ramsey-1/ramsey.mod b/tests/bgp/ramsey-1/ramsey.mod
index 0a66aa14f190fcdd2d0addcd62d47bfb220cb8b6..42595edec09aaf3f288ef3f92d999501aee0d60d 100644
--- a/tests/bgp/ramsey-1/ramsey.mod
+++ b/tests/bgp/ramsey-1/ramsey.mod
@@ -17,7 +17,7 @@ verbatim;
 
     bgp.write(M_);
     if isoctave
-        options = optimset('Display', 'iter', 'MaxFunEvals', 1000000,'MaxIter',100000,'Jacobian','on','TolFun',1e-6,'TolX',1e-6);
+        options = optimset('Display', 'iter', 'MaxFunEvals', 1000000,'MaxIter',100000,'Jacobian','on','TolFun',1e-7,'TolX',1e-7);
     else
         options = optimoptions('fsolve','Display','iter','Algorithm','levenberg-marquardt','MaxFunctionEvaluations',1000000,'MaxIterations',100000,'SpecifyObjectiveGradient',true,'FunctionTolerance',1e-6,'StepTolerance',1e-6);
     end
@@ -28,7 +28,7 @@ verbatim;
     else
         fun = @ramsey.bgpfun;
     end
-    y = 1+(rand(M_.endo_nbr,1)-.5)*.5;
+    y = 1+(rand(M_.endo_nbr,1)-.5)*.25;
     g = ones(M_.endo_nbr,1);% 1+(rand(M_.endo_nbr,1)-.5)*.1;
     [y, fval, exitflag] = fsolve(fun, [y;g], options);
     assert(max(abs(y(M_.endo_nbr+(1:M_.orig_endo_nbr))-1.02))<1e-6)