Improve delete character handling