Fixed a minor bug in recent batch submit code.

The bug was dormant because err was never True.
Merge pull request #268 from hjoliver/minor-bug-fix-in-batch-submit

Fixed a minor bug in recent batch submit code.