Fix (some) Emacs24 compatibility issues.
`last-command-char' is gone in Emacs24, it is `last-command-event' now.
Do not use `delete-backward-char'.