Remaining count optimization was not strong enough... < when it should be <=