Fixed error calculating in bisection