similar remove-method. The old code removed an element from a vector, which invalidates the iterator of the loop This resulted in a crash on certain platforms. Now the erasing is done the right way without invalidating the iterator."