Fix trailing newline in default instance print method

Part of the previous fix in #7 was lost with the merge from #6 at
c590b343abab930d63f29bfcdd2b2d0f84a84f01.

I have also added a test case for this.