Index: src/sas/sasgui/perspectives/fitting/basepage.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/basepage.py	(revision d3911e3cf881d888113c59010d5c63db40c0181b)
+++ src/sas/sasgui/perspectives/fitting/basepage.py	(revision 9e0aa69abc3080680008f6c3525d79d3fb3ba4e9)
@@ -1105,6 +1105,9 @@
         """
         for key, value in self.master_category_dict.iteritems():
+            formfactor = state.formfactorcombobox.split(":")
+            if isinstance(formfactor, list):
+                formfactor = formfactor[0]
             for list_item in value:
-                if state.formfactorcombobox in list_item:
+                if formfactor in list_item:
                     return self.categorybox.Items.index(key)
         return 0
@@ -1152,47 +1155,37 @@
         self._show_combox_helper()
         # select the current model
-        try:
-            # to support older version
-            category_pos = int(state.categorycombobox)
-        except:
-            state.formfactorcombobox = state.formfactorcombobox.lower()
-            state.formfactorcombobox = \
-                state.formfactorcombobox.replace('model', '')
-            state.formfactorcombobox = unicode(state.formfactorcombobox)
-            state.categorycombobox = unicode(state.categorycombobox)
-            if state.categorycombobox in self.categorybox.Items:
-                category_pos = self.categorybox.Items.index(
-                    state.categorycombobox)
-            else:
-                # Look in master list for model name (model.lower)
-                category_pos = self.get_cat_combo_box_pos(state)
+        state._convert_to_sasmodels()
+        state.categorycombobox = unicode(state.categorycombobox)
+        if state.categorycombobox in self.categorybox.Items:
+            category_pos = self.categorybox.Items.index(
+                state.categorycombobox)
+        else:
+            # Look in master list for model name (model.lower)
+            category_pos = self.get_cat_combo_box_pos(state)
 
         self.categorybox.Select(category_pos)
         self._show_combox(None)
-        try:
-            # to support older version
-            formfactor_pos = int(state.formfactorcombobox)
-        except:
-            formfactor_pos = 0
-            for ind_form in range(self.formfactorbox.GetCount()):
-                if self.formfactorbox.GetString(ind_form) == \
-                                                    (state.formfactorcombobox):
-                    formfactor_pos = int(ind_form)
+        from models import PLUGIN_NAME_BASE
+        if self.categorybox.GetValue() == 'Customized Models' \
+                and PLUGIN_NAME_BASE not in state.formfactorcombobox:
+            state.formfactorcombobox = \
+                PLUGIN_NAME_BASE + state.formfactorcombobox
+        formfactor_pos = 0
+        for ind_form in range(self.formfactorbox.GetCount()):
+            if self.formfactorbox.GetString(ind_form) == \
+                                                (state.formfactorcombobox):
+                formfactor_pos = int(ind_form)
+                break
+
+        self.formfactorbox.Select(formfactor_pos)
+
+        structfactor_pos = 0
+        if state.structurecombobox is not None:
+            state.structurecombobox = unicode(state.structurecombobox)
+            for ind_struct in range(self.structurebox.GetCount()):
+                if self.structurebox.GetString(ind_struct) == \
+                                                (state.structurecombobox):
+                    structfactor_pos = int(ind_struct)
                     break
-
-        self.formfactorbox.Select(formfactor_pos)
-
-        structfactor_pos = 0
-        try:
-            # to support older version
-            structfactor_pos = int(state.structurecombobox)
-        except:
-            if state.structurecombobox is not None:
-                state.structurecombobox = unicode(state.structurecombobox)
-                for ind_struct in range(self.structurebox.GetCount()):
-                    if self.structurebox.GetString(ind_struct) == \
-                                                    (state.structurecombobox):
-                        structfactor_pos = int(ind_struct)
-                        break
 
         self.structurebox.SetSelection(structfactor_pos)
@@ -1384,7 +1377,7 @@
         # self.state.struct_rbutton = self.struct_rbutton.GetValue()
         # self.state.plugin_rbutton = self.plugin_rbutton.GetValue()
-        self.state.structurecombobox = self.structurebox.GetLabel()
-        self.state.formfactorcombobox = self.formfactorbox.GetLabel()
-        self.state.categorycombobox = self.categorybox.GetLabel()
+        self.state.structurecombobox = self.structurebox.GetValue()
+        self.state.formfactorcombobox = self.formfactorbox.GetValue()
+        self.state.categorycombobox = self.categorybox.GetValue()
 
         # post state to fit panel
@@ -1587,41 +1580,44 @@
         if len(statelist) == 0 or len(listtorestore) == 0:
             return
-        if len(statelist) != len(listtorestore):
-            return
 
         for j in range(len(listtorestore)):
-            item_page = listtorestore[j]
-            item_page_info = statelist[j]
-            # change the state of the check box for simple parameters
-            if item_page[0] is not None:
-                item_page[0].SetValue(item_page_info[0])
-            if item_page[2] is not None:
-                item_page[2].SetValue(item_page_info[2])
-                if item_page[2].__class__.__name__ == "ComboBox":
-                    if item_page_info[2] in self.model.fun_list:
-                        fun_val = self.model.fun_list[item_page_info[2]]
-                        self.model.setParam(item_page_info[1], fun_val)
-            if item_page[3] is not None:
-                # show or hide text +/-
-                if item_page_info[2]:
-                    item_page[3].Show(True)
-                else:
-                    item_page[3].Hide()
-            if item_page[4] is not None:
-                # show of hide the text crtl for fitting error
-                if item_page_info[4][0]:
-                    item_page[4].Show(True)
-                    item_page[4].SetValue(item_page_info[4][1])
-                else:
-                    item_page[3].Hide()
-            if item_page[5] is not None:
-                # show of hide the text crtl for fitting error
-                item_page[5].Show(item_page_info[5][0])
-                item_page[5].SetValue(item_page_info[5][1])
-
-            if item_page[6] is not None:
-                # show of hide the text crtl for fitting error
-                item_page[6].Show(item_page_info[6][0])
-                item_page[6].SetValue(item_page_info[6][1])
+            for param in statelist:
+                if param[1] == listtorestore[j][1]:
+                    item_page = listtorestore[j]
+                    item_page_info = param
+                    if (item_page_info[1] == "theta" or item_page_info[1] ==
+                            "phi") and not self._is_2D():
+                        break
+                    # change the state of the check box for simple parameters
+                    if item_page[0] is not None:
+                        item_page[0].SetValue(item_page_info[0])
+                    if item_page[2] is not None:
+                        item_page[2].SetValue(item_page_info[2])
+                        if item_page[2].__class__.__name__ == "ComboBox":
+                            if item_page_info[2] in self.model.fun_list:
+                                fun_val = self.model.fun_list[item_page_info[2]]
+                                self.model.setParam(item_page_info[1], fun_val)
+                    if item_page[3] is not None:
+                        # show or hide text +/-
+                        if item_page_info[2]:
+                            item_page[3].Show(True)
+                        else:
+                            item_page[3].Hide()
+                    if item_page[4] is not None:
+                        # show of hide the text crtl for fitting error
+                        if item_page_info[4][0]:
+                            item_page[4].Show(True)
+                            item_page[4].SetValue(str(item_page_info[4][1]))
+                        else:
+                            item_page[3].Hide()
+                    if item_page[5] is not None:
+                        # show of hide the text crtl for fitting error
+                        item_page[5].Show(True)
+                        item_page[5].SetValue(str(item_page_info[5][1]))
+                    if item_page[6] is not None:
+                        # show of hide the text crtl for fitting error
+                        item_page[6].Show(True)
+                        item_page[6].SetValue(str(item_page_info[6][1]))
+                    break
 
     def _reset_strparam_state(self, listtorestore, statelist):
Index: src/sas/sasgui/perspectives/fitting/fitpage.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fitpage.py	(revision 24fd27a2f35f316c4971c10c5c3a317dd9357597)
+++ src/sas/sasgui/perspectives/fitting/fitpage.py	(revision 24fd27a2f35f316c4971c10c5c3a317dd9357597)
@@ -1190,6 +1190,7 @@
         self.state.slit_smearer = self.slit_smearer.GetValue()
 
-        self.state.structurecombobox = self.structurebox.GetLabel()
-        self.state.formfactorcombobox = self.formfactorbox.GetLabel()
+        self.state.structurecombobox = self.structurebox.GetValue()
+        self.state.formfactorcombobox = self.formfactorbox.GetValue()
+        self.state.categorycombobox = self.categorybox.GetValue()
         self.enable_fit_button()
         if self.model is not None:
Index: src/sas/sasgui/perspectives/fitting/models.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/models.py	(revision 313c5c92691602529afcffa8e76988a7cf6397b9)
+++ src/sas/sasgui/perspectives/fitting/models.py	(revision 0de74afcaf1a275ffd2e71099f9e17e398dcc39a)
@@ -23,4 +23,5 @@
 PLUGIN_LOG = os.path.join(os.path.expanduser("~"), '.sasview', PLUGIN_DIR,
                           "plugins.log")
+PLUGIN_NAME_BASE = '[plug-in] '
 
 def get_model_python_path():
@@ -181,5 +182,5 @@
             try:
                 model = load_custom_model(path)
-                model.name = "[plug-in] "+model.name
+                model.name = PLUGIN_NAME_BASE + model.name
                 plugins[model.name] = model
             except Exception:
Index: src/sas/sasgui/perspectives/fitting/pagestate.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/pagestate.py	(revision c8e19964f2dda929ccae8237e7b140a906cdf134)
+++ src/sas/sasgui/perspectives/fitting/pagestate.py	(revision 12361fdbc5e39477eb96b1b8744cf20d36a4f405)
@@ -25,4 +25,5 @@
 from lxml import etree
 
+from sasmodels import convert
 import sasmodels.weights
 
@@ -271,4 +272,5 @@
         # store value of chisqr
         self.tcChi = None
+        self.version = (1,0,0)
 
     def clone(self):
@@ -349,4 +351,5 @@
         obj.cb1 = copy.deepcopy(self.cb1)
         obj.smearer = copy.deepcopy(self.smearer)
+        obj.version = copy.deepcopy(self.version)
 
         for name, state in self.saved_states.iteritems():
@@ -355,4 +358,136 @@
             obj.saved_states[copy_name] = copy_state
         return obj
+
+    def _old_first_model(self):
+        """
+        Handle save states from 4.0.1 and before where the first item in the
+        selection boxes of category, formfactor and structurefactor were not
+        saved.
+        :return: None
+        """
+        if self.formfactorcombobox == '':
+            if self.categorycombobox == '' and len(self.parameters) == 3:
+                self.categorycombobox = "Shape-Independent"
+                self.formfactorcombobox = 'PowerLawAbsModel'
+            elif self.categorycombobox == '' and len(self.parameters) == 9:
+                self.categorycombobox = 'Cylinder'
+                self.formfactorcombobox = 'barbell'
+            elif self.categorycombobox == 'Shapes':
+                self.formfactorcombobox = 'BCCrystalModel'
+            elif self.categorycombobox == 'Uncategorized':
+                self.formfactorcombobox = 'LineModel'
+            elif self.categorycombobox == 'StructureFactor':
+                self.structurecombobox = 'HardsphereStructure'
+            elif self.categorycombobox == 'Customized Models':
+                self.formfactorcombobox = 'MySumFunction'
+            elif self.categorycombobox == 'Ellipsoid':
+                self.formfactorcombobox = 'core_shell_ellipsoid'
+            elif self.categorycombobox == 'Lamellae':
+                self.formfactorcombobox = 'lamellar'
+            elif self.categorycombobox == 'Paracrystal':
+                self.formfactorcombobox = 'bcc_paracrystal'
+            elif self.categorycombobox == 'Parallelepiped':
+                self.formfactorcombobox = 'core_shell_parallelepiped'
+            elif self.categorycombobox == 'Shape Independent':
+                self.formfactorcombobox = 'be_polyelectrolyte'
+            elif self.categorycombobox == 'Sphere':
+                self.formfactorcombobox = 'adsorbed_layer'
+            elif self.categorycombobox == 'Structure Factor':
+                self.formfactorcombobox = 'hardsphere'
+
+    @staticmethod
+    def param_remap_to_sasmodels_convert(params, is_string=False):
+        """
+        Remaps the parameters for sasmodels conversion
+
+        :param params: list of parameters (likely self.parameters)
+        :return: remapped dictionary of parameters
+        """
+        p = dict()
+        for fittable, name, value, _, uncert, lower, upper, units in params:
+            if not value:
+                value = numpy.nan
+            if not uncert or uncert[1] == '' or uncert[1] == 'None':
+                uncert[0] = False
+                uncert[1] = numpy.nan
+            if not upper or upper[1] == '' or upper[1] == 'None':
+                upper[0] = False
+                upper[1] = numpy.nan
+            if not lower or lower[1] == '' or lower[1] == 'None':
+                lower[0] = False
+                lower[1] = numpy.nan
+            if is_string:
+                p[name] = str(value)
+            else:
+                p[name] = float(value)
+            p[name + ".fittable"] = bool(fittable)
+            p[name + ".std"] = float(uncert[1])
+            p[name + ".upper"] = float(upper[1])
+            p[name + ".lower"] = float(lower[1])
+            p[name + ".units"] = units
+        return p
+
+    @staticmethod
+    def param_remap_from_sasmodels_convert(params):
+        """
+        Converts {name : value} map back to [] param list
+        :param params: parameter map returned from sasmodels
+        :return: None
+        """
+        p_map = []
+        for name, info in params.iteritems():
+            if ".fittable" in name or ".std" in name or ".upper" in name or \
+                            ".lower" in name or ".units" in name:
+                pass
+            else:
+                fittable = params.get(name + ".fittable", True)
+                std = params.get(name + ".std", '0.0')
+                upper = params.get(name + ".upper", 'inf')
+                lower = params.get(name + ".lower", '-inf')
+                units = params.get(name + ".units")
+                if std is not None and std is not numpy.nan:
+                    std = [True, str(std)]
+                else:
+                    std = [False, '']
+                if lower is not None and lower is not numpy.nan:
+                    lower = [True, str(lower)]
+                else:
+                    lower = [True, '-inf']
+                if upper is not None and upper is not numpy.nan:
+                    upper = [True, str(upper)]
+                else:
+                    upper = [True, 'inf']
+                param_list = [bool(fittable), str(name), str(info),
+                              "+/-", std, lower, upper, str(units)]
+                p_map.append(param_list)
+        return p_map
+
+    def _convert_to_sasmodels(self):
+        """
+        Convert parameters to a form usable by sasmodels converter
+
+        :return: None
+        """
+        # Create conversion dictionary to send to sasmodels
+        self._old_first_model()
+        p = self.param_remap_to_sasmodels_convert(self.parameters)
+        structurefactor, params = convert.convert_model(self.structurecombobox,
+                                                        p, False, self.version)
+        formfactor, params = convert.convert_model(self.formfactorcombobox,
+                                                   params, False, self.version)
+        if len(self.str_parameters) > 0:
+            str_pars = self.param_remap_to_sasmodels_convert(
+                self.str_parameters, True)
+            formfactor, str_params = convert.convert_model(
+                self.formfactorcombobox, str_pars, False, self.version)
+            for key, value in str_params.iteritems():
+                params[key] = value
+
+        if self.formfactorcombobox == 'SphericalSLDModel':
+            self.multi_factor += 1
+        self.formfactorcombobox = formfactor
+        self.structurecombobox = structurefactor
+        self.parameters = []
+        self.parameters = self.param_remap_from_sasmodels_convert(params)
 
     def _repr_helper(self, list, rep):
@@ -682,5 +817,7 @@
 
         attr = newdoc.createAttribute("version")
-        attr.nodeValue = '1.0'
+        import sasview
+        attr.nodeValue = sasview.__version__
+        # attr.nodeValue = '1.0'
         top_element.setAttributeNode(attr)
 
@@ -875,5 +1012,13 @@
             raise RuntimeError, msg
 
-        if node.get('version') and node.get('version') == '1.0':
+        if node.get('version'):
+            # Get the version for model conversion purposes
+            self.version = tuple(int(e) for e in
+                                 str.split(node.get('version'), "."))
+            # The tuple must be at least 3 items long
+            while len(self.version) < 3:
+                ver_list = list(self.version)
+                ver_list.append(0)
+                self.version = tuple(ver_list)
 
             # Get file name
@@ -1692,4 +1837,5 @@
                         name = original_fname
                     state.data.group_id = name
+                    state.version = fitstate.version
                     # store state in fitting
                     self.call_back(state=state,
