Fix multiline output in buffer