[PATCH] Fix bisection terminating condition