Add blank lines at appropriate places when printing output.

* Also: avoid writing out empty files.