Fix small undo/redo bug