sometimes we generate no newline at end; make sure it's there