Fix Cache saving crash

Because was deleting values of a dict while looping over its values...