Better unification of undo stack. #307.