Fixed buggy event handler scoping in iterators