Improved delete/backspace handling