Fix bug with Undo. Issue #61