Fixed a crash coused by new feature to disable undo