Not completely happy with everything here but this should fix the bugs related to settings getting cleared on save load.