Bug fix on iterator