Fixed one segfault during undo.