Index: src/sas/perspectives/fitting/fitting.py
===================================================================
--- src/sas/perspectives/fitting/fitting.py	(revision f21d4969d416d232125ec9af18b6bb0189f68ace)
+++ src/sas/perspectives/fitting/fitting.py	(revision 098f3d277d54e6ae4bae35ed0188be84b67fb171)
@@ -61,6 +61,6 @@
     Fitting plugin is used to perform fit
     """
-    def __init__(self):
-        PluginBase.__init__(self, name="Fitting")
+    def __init__(self, standalone=False):
+        PluginBase.__init__(self, name="Fitting", standalone=standalone)
 
         #list of panel to send to guiframe
@@ -221,6 +221,6 @@
         Get the python editor panel
         """
-        event_id = event.GetId()
-        label = self.edit_menu.GetLabel(event_id)
+        id = event.GetId()
+        label = self.edit_menu.GetLabel(id)
         from sas.perspectives.calculator.pyconsole import PyConsole
         filename = os.path.join(models.find_plugins_dir(), label)
@@ -236,6 +236,6 @@
         Delete custom model file
         """
-        event_id = event.GetId()
-        label = self.delete_menu.GetLabel(event_id)
+        id = event.GetId()
+        label = self.delete_menu.GetLabel(id)
         toks = os.path.splitext(label)
         path = os.path.join(models.find_plugins_dir(), toks[0])
@@ -256,5 +256,5 @@
                 #                                      info='warning'))
             else:
-                self.delete_menu.Delete(event_id)
+                self.delete_menu.Delete(id)
                 for item in self.edit_menu.GetMenuItems():
                     if item.GetLabel() == label:
@@ -272,5 +272,5 @@
         Edit summodel template and make one
         """
-        event_id = event.GetId()
+        id = event.GetId()
         model_manager = models.ModelManager()
         model_list = model_manager.get_model_name_list()
@@ -290,5 +290,5 @@
             self.new_model_frame.Show(True)
         else:
-            event_id = event.GetId()
+            id = event.GetId()
             dir_path = models.find_plugins_dir()
             title = "New Custom Model Function"
@@ -332,13 +332,13 @@
         Set list of the edit model menu labels
         """
-        wx_id = wx.NewId()
+        id = wx.NewId()
         #new_model_menu = wx.Menu()
-        self.edit_model_menu.Append(wx_id, 'New',
+        self.edit_model_menu.Append(id, 'New',
                                    'Add a new model function')
-        wx.EVT_MENU(owner, wx_id, self.make_new_model)
-        wx_id = wx.NewId()
-        self.edit_model_menu.Append(wx_id, 'Sum|Multi(p1, p2)',
+        wx.EVT_MENU(owner, id, self.make_new_model)
+        id = wx.NewId()
+        self.edit_model_menu.Append(id, 'Sum|Multi(p1, p2)',
                                     'Sum of two model functions')
-        wx.EVT_MENU(owner, wx_id, self.make_sum_model)
+        wx.EVT_MENU(owner, id, self.make_sum_model)
         e_id = wx.NewId()
         self.edit_menu = wx.Menu()
@@ -376,7 +376,7 @@
                         has_file = True
                 if not has_file:
-                    wx_id = wx.NewId()
-                    submenu.Append(wx_id, name)
-                    wx.EVT_MENU(owner, wx_id, menu)
+                    id = wx.NewId()
+                    submenu.Append(id, name)
+                    wx.EVT_MENU(owner, id, menu)
                     has_file = False
 
@@ -397,8 +397,8 @@
         Create a page to access simultaneous fit option
         """
-        event_id = event.GetId()
+        id = event.GetId()
         caption = "Const & Simul Fit"
         page = self.sim_page
-        if event_id == self.id_batchfit:
+        if id == self.id_batchfit:
             caption = "Combined Batch"
             page = self.batch_page
@@ -539,5 +539,5 @@
                         self.add_fit_page(data=[data])
             except:
-                msg = "Fitting Set_data: " + str(sys.exc_value)
+                msg = "Fitting set_data: " + str(sys.exc_value)
                 wx.PostEvent(self.parent, StatusEvent(status=msg, info="error"))
 
@@ -670,4 +670,8 @@
         :param weight: current dy data
         """
+        # If we are not dealing with a specific fit problem, then
+        # there is no point setting the weights.
+        if fid is None:
+            return
         if uid in self.page_finder.keys():
             self.page_finder[uid].set_weight(flag=flag, is2d=is2d)
@@ -715,6 +719,6 @@
         for uid, value in self.page_finder.iteritems():
             if uid != sim_page_id and uid != self.batch_page.uid:
-                model_list = value.get_model()
-                model = model_list[0]
+                list = value.get_model()
+                model = list[0]
                 if model.name == modelname:
                     value.set_model_param(names, values)
@@ -1564,4 +1568,5 @@
         """
         if event.panel is not None:
+            new_panel = event.panel
             self.slicer_panels.append(event.panel)
             # Set group ID if available
@@ -1647,5 +1652,5 @@
             #find if this theory was already plotted and replace that plot given
             #the same id
-            self.page_finder[page_id].get_theory_data(fid=data.id)
+            theory_data = self.page_finder[page_id].get_theory_data(fid=data.id)
 
             if data.is_data:
