Using temp file for modified but unsaved changes. Some other tweaks.