Fixed a bug in character deletion and added some more functionality.