Improved the support for undo/redo in inhereters (still not finished).