Defining more strongly the types.  Fix undo/redo (partial rollback).