Fix a bug that made the first map change did not trigger the undo button.