Various fixes to undo and TextOption