Adapted to new vec iterator api.