Fix leaky shard creation.