Fix the batch bug