Fix for uninitialized batchnum