this will fail if you have live tv playing and open some other file. then it will load the video settings of the file before you saved the channels settings.
those errors can be avoided if you move load/save channel settings to the same locations where load/save video settings is done.