Minor changes to help downstream Riak project

Niggle: now that the end-of-batch check doesn't reference `i`, we could use the neater `for` syntax.