Fix in batch size calculation