Replace save and restore with copy.