Fixed issues with chunking and iterating