Fix plan_ahead_limit triggering too early