Probable fix for bug 2862

Create a copy of the event register for iteration
Merge origin/master