Handle EOF on iterator