Tweak undo/redo-code for text