Fixed file editing. Closes #1