Merge pull request #1 from moreati/master

Batch mode enhancements
Fix memory leak
Merge remote-tracking branch 'jimparis/master'