iterator becomes invalid after an erase operation

Daniel,

Here is the bug fix I talked about. The problem was to reuse an iterator after using it in an erase operation. C++ standard specify that this iterator is invalid after this operation. So I pick up valid iterator returned by erase method to do the insert.