Bugfix in range iterator