Work on save/restore. Not perfect but mostly works.