fix wrong array indexes in publish_batch
Merge pull request #110 from znarf/master

fix wrong array indexes in publish_batch