fix iterator manipulation on erase

erase() returns a valid iterator that can be used to continue the iteration.