Improve tests involving iterators