Fix length calculation for Mac new lines /r/n