Added File overwrite protection and fixed minor error on losing entry contents on open failure.