This avoids output that does not end with a newline, which is inconvenient when working with many tools. Updated tests accordingly.