Fix a bug that broke the computation in cases when 
in piece-wise solving when one of neighbouring segments
has a solution and the other does not.