Add more code to the newlines handling. Run the tests on output too to verify double-running does not produce different output.