Support for undo/redo. #2