fixes for editing empty files, corrected