Fixed line endings when writing JSON.