Fix up logic for cleaning up old shard allocations

Change-Id: Ib9f494578ed85174e555378df08cfab4caf14716
Merge "Fix up logic for cleaning up old shard allocations"