bug fixes in batchrun