Fix new line characted being placed in the wrong place