Fixed a few bugs related to line endings (Normalised line endings doesn't work for codecs.open)