Minor bug fix when pressing backspace and special characters on buffer