Fixed bug in bisection algorithm - if bisecting further leads to a
failure, use the less bisected result instead.
Also, optimised to avoid running the solver twice on the same segment
with the same initial values.