adds newlines at eof, ref #164