Fix newlines and echoing. For some definition of "fix"