Fix simple bug in iter_length