Fix error - storing of the end iterator (previous failure).