[Fixes bug 215] Variable undo now works properly.