More minor cleanups

make sure streams get closed
remove superfluous use of StringBuilder
fix format strings for i18n new lines