Fix bug related to num_batch and size_batch