Fixed an issue in batching