Changed flow of bisearch to be more robust.