Bugfix for newlines

In some cases line breaks are indicated with the \r character instead of the \n.