removed redundant newlines in StringWriter