Attempt to fix undo stack