Fix events iterator invalidating

Thank's goes to MSVC debugger.