Fix issues with EOL characters

* If a file doesn't end with an empty line, adding a new property and then saving will corrupt it
* Removing a property doesn't remove its EOL char, which results in leaving an empty line in the file