Do not rely on DOM state when saving. Fixes #53. Possibly #65.