Fix chunking in InfiniteEncoder