be smarter about punctuation when joining

[fixes #1]