Merge pull request #540 from ndawe/master

batch improvements