Avoiding overflow in binary partition