Fixed a bug with the caret updater and fixed it so saving does not discard all undos