Fix ugly stacktrace if try to iterate twice.