Fixed the issue with a duplicated file being closed but not saved, and being put in the list of recent files (closes #265).