Reworked the text buffer.