more fixes for undo/redo