Fix iterator when a callback is removed.