Fixed the unsaved changes flag not being reset after opening a file