Undo/redo refinement, minor fixes