Do batched operations correctly
fix some specs
Use InnerCounter and InnerSet