Fixed line end encoding and tweaked formatter for consistency