Index: sansview/perspectives/fitting/fitting.py
===================================================================
--- sansview/perspectives/fitting/fitting.py	(revision cc316087447594027dc1ee6e8fb72cb75f171858)
+++ sansview/perspectives/fitting/fitting.py	(revision 0fd2f275b7a582f477e5789996ad5256c3f3c99c)
@@ -348,10 +348,13 @@
     def  on_set_state_helper(self,event=None):
         """
-        Set_state_helper. This actually sets state after plotting data from state file.
-        
-        : event: FitStateUpdateEvent called by dataloader.plot_data from guiframe
+        Set_state_helper. This actually sets state 
+        after plotting data from state file.
+        
+        : event: FitStateUpdateEvent called 
+            by dataloader.plot_data from guiframe
         """
         if len(self.temp_state) == 0:
-            if self.state_index==0 and len(self.mypanels) <= 0 and self.sfile_ext =='.svs':
+            if self.state_index==0 and len(self.mypanels) <= 0 \
+            and self.sfile_ext =='.svs':
                 self.fit_panel.add_default_pages()
                 self.temp_state = []
@@ -441,5 +444,6 @@
         Used by simfitpage.py to reset a parameter given the string constrainst.
          
-        :param modelname: the name ot the model for with the parameter has to reset
+        :param modelname: the name ot the model for with the parameter 
+                            has to reset
         :param value: can be a string in this case.
         :param names: the paramter name
@@ -798,5 +802,6 @@
                              NewPlotEvent(group_id=group_id,
                                                action="delete"))
-                    self.parent.update_data(prev_data=theory_data, new_data=data)      
+                    self.parent.update_data(prev_data=theory_data,
+                                             new_data=data)      
             else:
                 if theory_data is not None:
@@ -806,5 +811,6 @@
                              NewPlotEvent(group_id=group_id,
                                                action="delete"))
-                    self.parent.update_data(prev_data=theory_data, new_data=data)   
+                    self.parent.update_data(prev_data=theory_data,
+                                             new_data=data)   
               
         self.store_data(uid=page.uid, data=page.get_data(),
@@ -824,5 +830,6 @@
         """
         for item in self.parent.panels:
-            if self.parent.panels[item].window_caption.startswith(event.panel_name):
+            name = event.panel_name
+            if self.parent.panels[item].window_caption.startswith(name):
                 self.parent.panels[item].set_slicer(event.type, event.params)
                 
@@ -932,6 +939,6 @@
             try:
                 if single_data.id in pointer_to_fitproblem:
-                     new_value = self.page_finder[pointer_to_fitproblem[single_data.id]]
-                     self._fit_setter(data=single_data, value=new_value, 
+                     v = self.page_finder[pointer_to_fitproblem[single_data.id]]
+                     self._fit_setter(data=single_data, value=v, 
                                      fitter=fitter,
                                      pars=pars,
@@ -973,5 +980,6 @@
         print "update_fit result", result
         
-    def _batch_single_fit_complete_helper(self,result, pars, page_id, elapsed=None):
+    def _batch_single_fit_complete_helper(self,result, pars, page_id, 
+                                          elapsed=None):
         """
         Fit result are display in batch mode
@@ -990,9 +998,11 @@
                 for index  in range(len(pars)):
                     batch_result[pars[index]].append(res.pvec[index])
-                    batch_result["error on %s" % pars[index]].append(res.stderr[index])
+                    item = res.stderr[index]
+                    batch_result["error on %s" % pars[index]].append(item)
               
             pid = page_id[0]
             self.page_finder[pid].set_result(result=batch_result)      
-            self.parent.on_set_batch_result(data=batch_result, name=self.sub_menu)
+            self.parent.on_set_batch_result(data=batch_result, 
+                                            name=self.sub_menu)
             
         
@@ -1012,5 +1022,6 @@
             del self.fit_thread_list[page_id[0]] 
         if self.batch_on:
-            wx.CallAfter(self._batch_single_fit_complete_helper, result, pars, page_id, elapsed=None)
+            wx.CallAfter(self._batch_single_fit_complete_helper,
+                          result, pars, page_id, elapsed=None)
             return 
         else:  
@@ -1046,5 +1057,6 @@
        
                     cpage = self.fit_panel.get_page_by_id(uid)
-                    # Make sure we got all results (CallAfter is important to MAC)
+                    # Make sure we got all results 
+                    #(CallAfter is important to MAC)
                     wx.CallAfter(cpage.onsetValues, result.fitness, 
                                       param_name, result.pvec, result.stderr)
