Fix issue with deleting last character.