Improved handling of unsaved data