Fixed the creation of Undos in the MainFrame to not create them for
nulls.