Fixed infinite loop error
Bugfix for bug in last commit, where-loop would not terminate due to
missing iter.next()-statement.