Bug fixes related to deletion of text and tokens