Removed unneeded debugging output.
Corrected handling of backspace.
Corrected initialisation of display buffer in text mode.