Updated newline processing