Added debug logging on getBatches