Fix case where a line does not end with a newline