Index: fittingview/src/sans/perspectives/fitting/fitting.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/fitting.py	(revision 7db52f1912cba2e4449a15df666a973a73b05588)
+++ fittingview/src/sans/perspectives/fitting/fitting.py	(revision 7643ba2b33242117da07c47e54343c982c8029c3)
@@ -1100,8 +1100,4 @@
                         msg += "Data %s and Model %s did not fit.\n" % (data_name, 
                                                                         model_name)
-                        print msg
-                        wx.PostEvent(self.parent, StatusEvent(status=msg,
-                                                              error="error",
-                                                              type="stop"))
                     else:
                         #Separate result in to data corresponding to each page
@@ -1156,9 +1152,12 @@
                     self.page_finder[pid][data.id].set_result(res)
                     fitproblem = self.page_finder[pid][data.id]
-                
                     qmin, qmax = fitproblem.get_range()
                     flag = issubclass(data.__class__, Data2D)
+                    correct_result = False
                     if not flag:
-                        self._complete1D(x=data.x, y=res.theory, page_id=pid, 
+                        if len(res.theory) == len(res.index) and \
+                            len(res.index) == len(data.y):
+                            correct_result = True
+                            self._complete1D(x=data.x, y=res.theory, page_id=pid, 
                                          elapsed=None, 
                                          index=res.index, model=model,
@@ -1167,6 +1166,19 @@
                                          data=data, update_chisqr=False, 
                                          source='fit')
+                        else:
+                            data_name = str(None)
+                            if data is not None:
+                                data_name = str(data.name)
+                            model_name = str(None)
+                            if model is not None:
+                                model_name = str(model.name)
+                            msg += "Data %s and Model %s did not fit.\n" % (data_name, 
+                                                                            model_name)
+                            
                     else:
-                        self._complete2D(image=data.data, data=data,
+                        if len(res.theory)== len(res.index) and \
+                            len(res.index) == len(data.data):
+                            correct_result = True
+                            self._complete2D(image=res.theory, data=data,
                                           model=model,
                                           page_id=pid,  elapsed=None, 
@@ -1177,10 +1189,23 @@
                                          update_chisqr=False, 
                                          source='fit')
-                        
-                    self.on_set_batch_result(page_id=pid, 
+                        else:
+                            data_name = str(None)
+                            if data is not None:
+                                data_name = str(data.name)
+                            model_name = str(None)
+                            if model is not None:
+                                model_name = str(model.name)
+                            msg += "Data %s and Model %s did not fit.\n" % (data_name, 
+                                                                            model_name)
+                            
+                    if correct_result : 
+                        self.on_set_batch_result(page_id=pid, 
                                              fid=data.id, 
                                              batch_outputs=batch_outputs, 
                                              batch_inputs=batch_inputs)
           
+        #print msg
+        wx.PostEvent(self.parent, StatusEvent(status=msg, error="error",
+                                                              type="stop"))
         wx.CallAfter(self.parent.on_set_batch_result,batch_outputs, 
                                             batch_inputs,
@@ -1207,6 +1232,6 @@
         cell.label = data.name
         cell.value = index
-        theory_data.id = str(page_id) + "model"
-        theory_data.name =  model.name + "[%s]" % str(model.__class__.__name__)
+        theory_data.id = wx.NewId()
+        theory_data.name = model.name + "[%s]" % str(model.__class__.__name__)
         cell.object = [data, theory_data]
         batch_outputs["Data"].append(cell)
@@ -1248,5 +1273,5 @@
             for uid in page_id:
                 res = result[index]
-                if res.fitness is not None or \
+                if res.fitness is None or \
                     not numpy.isfinite(res.fitness) or \
                     numpy.any(res.pvec == None) or \
@@ -1258,17 +1283,18 @@
                                          type="stop"))
                     self._update_fit_button(page_id)
-                cpage = self.fit_panel.get_page_by_id(uid)
-                # Make sure we got all results 
-                #(CallAfter is important to MAC)
-                wx.CallAfter(cpage.onsetValues, res.fitness, res.param_list, 
+                else:
+                    cpage = self.fit_panel.get_page_by_id(uid)
+                    # Make sure we got all results 
+                    #(CallAfter is important to MAC)
+                    wx.CallAfter(cpage.onsetValues, res.fitness, res.param_list, 
                              res.pvec, res.stderr)
-                index += 1
-                cpage._on_fit_complete()
-                if res.stderr == None:
-                    msg = "Fit Abort: "
-                else:
-                    msg = "Fitting: "
-                msg += "Completed!!!"
-                wx.PostEvent(self.parent, StatusEvent(status=msg))
+                    index += 1
+                    cpage._on_fit_complete()
+                    if res.stderr == None:
+                        msg = "Fit Abort: "
+                    else:
+                        msg = "Fitting: "
+                    msg += "Completed!!!"
+                    wx.PostEvent(self.parent, StatusEvent(status=msg))
         except ValueError:
                 raise
@@ -1455,5 +1481,5 @@
             caption = current_pg.window_caption
             self.page_finder[page_id].set_fit_tab_caption(caption=caption)
-            new_plot.id =  str(page_id) + "model"
+           
             self.page_finder[page_id].set_theory_data(data=new_plot, 
                                                       fid=data.id)
