Fixed a bug with unsaved files and marking unsaved