bugfixes for batch processing