Fixed bug where newlines would be swallowed or inserted