Minor fixes in chunk iterator