SML+ENH: ensure last newline is printed properly