Fix for issue #140 (Ctrl-Z in editor)

Undo buffer was filled inconsistently with forward changes.