Index: sansview/perspectives/fitting/basepage.py
===================================================================
--- sansview/perspectives/fitting/basepage.py	(revision 35c9d31c50d0c7d7e49c35bcbc2dcc53b9a12b4d)
+++ sansview/perspectives/fitting/basepage.py	(revision edd166b7701db6213bf2eceec179494a8cda162e)
@@ -6,4 +6,5 @@
 import copy 
 import math
+import string
 from sans.guiframe.utils import format_number,check_float
 from sans.guicomm.events import StatusEvent   
@@ -496,6 +497,5 @@
         if hasattr(self, "disp_box"):
             self.state.disp_box = copy.deepcopy(self.disp_box.GetSelection())
-        
-        self.state.model = self.model.clone()
+
         self.state.model.name= self.model.name
         #if not hasattr(self.model, "_persistency_dict"):
@@ -504,8 +504,11 @@
         
         #Remember fit engine_type for fit panel
-        if self.engine_type == None and self.manager !=None:
-            self.engine_type = self.manager._return_engine_type()
-        
-        self.state.engine_type = self.engine_type
+        if self.engine_type == None: 
+            self.engine_type = "scipy"
+        if self.manager !=None:
+            self.manager._on_change_engine(engine=self.engine_type)
+                #self.engine_type = self.manager._return_engine_type()
+        
+            self.state.engine_type = self.engine_type
 
         new_state = self.state.clone()
@@ -720,11 +723,4 @@
         self._save_plotting_range()
         
-        #self.state.orientation_params =[]
-        #self.state.orientation_params_disp =[]
-        #self.state.parameters =[]
-        #self.state.fittable_param =[]
-        #self.state.fixed_param =[]
-
-        
         ## save checkbutton state and txtcrtl values
         self._copy_parameters_state(self.orientation_params,
@@ -755,6 +751,5 @@
         self.enable2D= state.enable2D
         self.engine_type = state.engine_type
-        
-        #???
+
         self.disp_cb_dict = state.disp_cb_dict
         self.disp_list = state.disp_list
@@ -768,5 +763,5 @@
         self._set_model_sizer_selection( self.model )
         self.set_model_param_sizer(self.model)
-        
+
         ## reset value of combox box
         self.structurebox.SetSelection(state.structurecombobox )
@@ -783,5 +778,5 @@
         if hasattr(self, "cb1"):   
             self.cb1.SetValue(state.cb1)
-      
+     
         ## reset state of checkbox,textcrtl  and  regular parameters value
             
@@ -794,5 +789,5 @@
         self.enable_disp.SetValue(state.enable_disp)
         self.disable_disp.SetValue(state.disable_disp)
-
+        
         if hasattr(self, "disp_box"):
             
@@ -836,7 +831,8 @@
                     self.disp_cb_dict = copy.deepcopy(state.disp_cb_dict) 
                     self.state.disp_cb_dict = copy.deepcopy(state.disp_cb_dict)
-      
+
         ##plotting range restore    
         self._reset_plotting_range(state)
+
         ## smearing info  restore
         if hasattr(self,"enable_smearer"):
@@ -844,14 +840,13 @@
             self.enable_smearer.SetValue(state.enable_smearer)
             self.disable_smearer.SetValue(state.disable_smearer)
-            self.onSmear(event=None)
-            self.tcChi.SetLabel(str( state.tcChi))            
+            self.onSmear(event=None)           
        
         ## reset state of checkbox,textcrtl  and dispersity parameters value
         self._reset_parameters_state(self.fittable_param,state.fittable_param)
         self._reset_parameters_state(self.fixed_param,state.fixed_param)
-    
+        
         ## draw the model with previous parameters value
         self._onparamEnter_helper()
-        
+
         ## reset context menu items
         self._reset_context_menu()
@@ -860,36 +855,5 @@
         self.state = state.clone() 
         self._draw_model()
-       
-    def _clear_Err_on_Fit(self):
-        """
-            hide the error text control shown 
-            after fitting
-        """
-        """
-        if hasattr(self,"text2_3"):
-            self.text2_3.Hide()
-
-        if len(self.parameters)>0:
-            for item in self.parameters:
-                ## hide statictext +/-    
-                if item[3]!=None and item[3].IsShown():
-                    item[3].Hide()
-                ## hide textcrtl  for error after fit
-                if item[4]!=None and item[4].IsShown():                   
-                    item[4].Clear()
-                    item[4].Hide()
-        if len(self.fittable_param)>0:
-            for item in self.fittable_param:
-                ## hide statictext +/-    
-                if item[3]!=None and item[3].IsShown():
-                    item[3].Hide()
-                ## hide textcrtl  for error after fit
-                if item[4]!=None and item[4].IsShown():
-                    item[4].Clear()
-                    item[4].Hide()
-        ##Is this layout necessary? Had a problem w/MAC:Not anymore.
-        self.Layout()
-        """
-        return        
+
     def _selectDlg(self):
         """
@@ -963,18 +927,13 @@
         #self._undo.Enable(True)
         if self.model !=None:
-            
-           
-            # Flag to register when a parameter has changed.
+            # Flag to register when a parameter has changed.      
             is_modified = False
-            is_modified =self._check_value_enter( self.fittable_param ,is_modified)
-            is_modified =self._check_value_enter( self.fixed_param ,is_modified)
-            is_modified =self._check_value_enter( self.parameters ,is_modified) 
-     
-            if is_modified:
-                #self.sizer3.Layout()
-                self.Layout()
-                self.Refresh()
-            else:
-                self.Layout()
+            try:
+                is_modified =self._check_value_enter( self.fittable_param ,is_modified)
+                is_modified =self._check_value_enter( self.fixed_param ,is_modified)
+                is_modified =self._check_value_enter( self.parameters ,is_modified) 
+            except:
+                pass
+            #if is_modified:
 
             # Here we should check whether the boundaries have been modified.
@@ -1006,5 +965,7 @@
                 self.state_change= True
                 self._draw_model() 
-                
+            self.Layout()
+            self.Refresh()
+
     def _update_paramv_on_fit(self):
         """
@@ -1021,5 +982,5 @@
             self._check_value_enter( self.fittable_param ,is_modified)
             self._check_value_enter( self.fixed_param ,is_modified)
-            self._check_value_enter( self.parameters ,is_modified) 
+            self._check_value_enter( self.parameters ,is_modified)
 
             # If qmin and qmax have been modified, update qmin and qmax and 
@@ -1036,5 +997,4 @@
                     if float(self.npts.GetValue()) !=  self.num_points:
                         self.num_points = float(self.npts.GetValue())
-
         else:
             msg= "Cannot Fit :Must select a model!!!  "
@@ -1501,4 +1461,8 @@
         tcrtl= event.GetEventObject()
         
+        #Clear msg if previously shown.
+        msg= ""
+        wx.PostEvent(self.parent.parent, StatusEvent(status = msg ))
+        
         ## save current state
         self.save_current_state()
@@ -1511,5 +1475,5 @@
             
             self._onparamEnter_helper()
-            
+        
         else:
             msg= "Cannot Plot :Must enter a number!!!  "
@@ -1527,45 +1491,63 @@
         if len(list)==0:
             return is_modified
+        
         for item in list:
-            try:
-                name = str(item[1])
-                if hasattr(self,"text2_3") and self.text2_3.IsShown():
-                    if hasattr(self,"item[4]")and self.item[4] == None:
-                        self.text2_3.Hide()
-                        
+            #skip angle parameters for 1D
+            if self.data.__class__.__name__ !="Data2D":
+                if item in self.orientation_params:
+                    continue
+            #try:
+            name = str(item[1])
+            
+            if string.find(name,".npts") ==-1 and string.find(name,".nsigmas")==-1:      
                 ## check model parameters range             
                 param_min= None
                 param_max= None
+
                 ## check minimun value
-                if item[5]!= None:
+                if item[5]!= None and item[5]!= "":
                     if item[5].GetValue().lstrip().rstrip()!="":
-                        param_min = float(item[5].GetValue())
+                        try:
+                            param_min = float(item[5].GetValue())
+                        except:
+                            msg = "Wrong Fit parameter range entered "
+                            wx.PostEvent(self.parent.parent, StatusEvent(status = msg))
+                            raise ValueError, msg
                         is_modified = True
                 ## check maximum value
-                if item[6]!= None:
+                if item[6]!= None and item[5]!= "":
                     if item[6].GetValue().lstrip().rstrip()!="":
-                        param_max = float(item[6].GetValue())
+                        try:
+                            param_max = float(item[6].GetValue())
+                        except:
+                            msg = "Wrong Fit parameter range entered "
+                            wx.PostEvent(self.parent.parent, StatusEvent(status = msg))
+                            raise ValueError, msg
                         is_modified = True
                 from sans.guiframe.utils import check_value
+
                 if param_min != None and param_max !=None:
                     if not check_value(item[5], item[6]):
                         msg= "Wrong Fit range entered for parameter "
                         msg+= "name %s of model %s "%(name, self.model.name)
-                        wx.PostEvent(self.parent.parent, StatusEvent(status = msg ))
+                        wx.PostEvent(self.parent.parent, StatusEvent(status = msg))
+  
                 if name in self.model.details.keys():   
-                    self.model.details[name][1:]= param_min,param_max
-                
-                value= float(item[2].GetValue())
-
-                # If the value of the parameter has changed,
-                # +update the model and set the is_modified flag
-                if value != self.model.getParam(name):
-                    self.model.setParam(name,value)
-                    is_modified = True   
-
-            except:
-                msg= "Model Drawing  Error:wrong value entered : %s"% sys.exc_value
-                wx.PostEvent(self.parent.parent, StatusEvent(status = msg ))
-                return 
+                    if  param_min != self.model.details[name][1] or param_max != self.model.details[name][2]:
+                        self.model.details[name][1:3]= param_min,param_max
+                        is_modified = True
+    
+                else:
+                    self.model.details [name] = ["",param_min,param_max] 
+                    is_modified = True
+            
+            value= float(item[2].GetValue())
+  
+            # If the value of the parameter has changed,
+            # +update the model and set the is_modified flag
+            if value != self.model.getParam(name):
+                self.model.setParam(name,value)
+                is_modified = True   
+
         return is_modified 
         
@@ -1617,5 +1599,5 @@
         self.sizer5.Layout()
         self.Layout()
-        #self.Refresh()      
+        self.Refresh()      
           
         
@@ -1648,4 +1630,5 @@
                 if item in self.param_toFit:
                     self.param_toFit.remove(item)
+
             for item in self.orientation_params_disp:
                 if item in self.param_toFit:
Index: sansview/perspectives/fitting/fitpage.py
===================================================================
--- sansview/perspectives/fitting/fitpage.py	(revision c13b8cc92f5698baf2564c879c9dad33fa3e81f5)
+++ sansview/perspectives/fitting/fitpage.py	(revision edd166b7701db6213bf2eceec179494a8cda162e)
@@ -44,5 +44,5 @@
         ## default fitengine type
         self.engine_type = None
-
+        
         ## draw sizer
         self._fill_datainfo_sizer()
@@ -57,5 +57,5 @@
                 self.enable_smearer.Disable()
                 self.disable_smearer.Disable()
-       
+        self.disp_cb_dict = {}
         ## to update the panel according to the fit engine type selected
         self.Bind(EVT_FITTER_TYPE,self._on_engine_change)
@@ -78,6 +78,6 @@
         """
         self.engine_type = event.type
-         
         if len(self.parameters)==0:
+            self.Layout()
             return
         if event.type =="park":
@@ -138,5 +138,4 @@
                     item[6].Show(True)
         self.Layout()
-        self.SetScrollbars(20,20,25,65)
         
     
@@ -336,6 +335,6 @@
         for item in self.model.dispersion.keys():
             if not item in self.model.orientation_params:
-                #if not self.disp_cb_dict.has_key(item):
-                #    self.disp_cb_dict[item]= None
+                if not self.disp_cb_dict.has_key(item):
+                    self.disp_cb_dict[item]= None
                 name1=item+".width"
                 name2=item+".npts"
@@ -429,5 +428,6 @@
         for item in self.model.dispersion.keys():
             if  item in self.model.orientation_params:
-     
+                if not self.disp_cb_dict.has_key(item):
+                    self.disp_cb_dict[item]= None
                 name1=item+".width"
                 name2=item+".npts"
@@ -497,7 +497,5 @@
                         if self.engine_type=="park" and self.data.__class__.__name__ =="Data2D":
                             ctl3.Show(True)
-                            ctl3.Enable(True)
                             ctl4.Show(True) 
-                            ctl4.Enable(True)                           
                             
                             
@@ -545,8 +543,9 @@
                             self.orientation_params_disp.append([None,name3, Tct2
                                                      ,None,None, None, None,None])
+        """
         #Display units text on panel
         for item in self.model.dispersion.keys(): 
             name = item +".width"  
-   
+        """
         self.state.disp_cb_dict = copy.deepcopy(self.disp_cb_dict)  
           
@@ -592,5 +591,5 @@
         
         #Clear errors if exist from previous fitting
-        self._clear_Err_on_Fit() 
+        #self._clear_Err_on_Fit() 
 
         # Remove or do not allow fitting on the Q=0 point, especially when y(q=0)=None at x[0].         
@@ -677,8 +676,10 @@
         """
         tcrtl= event.GetEventObject()
+        #Clear msg if previously shown.
+        msg= ""
+        wx.PostEvent(self.parent.parent, StatusEvent(status = msg ))
         
         if check_float(tcrtl):
             self._onparamEnter_helper()
-            
             temp_smearer = None
             if self.enable_smearer.GetValue():
@@ -693,4 +694,5 @@
                 wx.PostEvent(self.parent, event)
                 self.state_change= False
+ 
         else:
             msg= "Cannot Plot :Must enter a number!!!  "
@@ -703,32 +705,75 @@
             Check validity of value enter in the parameters range field
         """
-        is_modified = True   
+        
         tcrtl= event.GetEventObject()
+        #Clear msg if previously shown.
+        msg= ""
+        wx.PostEvent(self.parent.parent, StatusEvent(status = msg ))
+        # Flag to register when a parameter has changed.
+        is_modified = False
         if tcrtl.GetValue().lstrip().rstrip()!="":
             try:
                 value = float(tcrtl.GetValue())
                 tcrtl.SetBackgroundColour(wx.WHITE)
-                tcrtl.Refresh()
+                self._check_value_enter(self.fittable_param ,is_modified)
+                self._check_value_enter(self.parameters ,is_modified) 
+
             except:
                 tcrtl.SetBackgroundColour("pink")
-                tcrtl.Refresh()
-                return
+                msg= "Model Error:wrong value entered : %s"% sys.exc_value
+                wx.PostEvent(self.parent.parent, StatusEvent(status = msg ))
+                return 
         else:
            tcrtl.SetBackgroundColour(wx.WHITE)
-           self.save_current_state()
-           is_modified = False
            
-        if is_modified:
-            self._onparamEnter_helper()
-        ## new state posted    
-        if self.state_change:
-            #self._undo.Enable(True)
-            self.save_current_state()
-            event = PageInfoEvent(page = self)
-            wx.PostEvent(self.parent, event)
-            self.state_change= False
+        #self._undo.Enable(True)
+        self.save_current_state()
+        event = PageInfoEvent(page = self)
+        wx.PostEvent(self.parent, event)
+        self.state_change= False
         self.Layout()
         self.Refresh()                
 
+       
+    def _clear_Err_on_Fit(self):
+        """
+            hide the error text control shown 
+            after fitting
+        """
+        
+        if hasattr(self,"text2_3"):
+            self.text2_3.Hide()
+
+        if len(self.parameters)>0:
+            for item in self.parameters:
+                #Skip t ifhe angle parameters if 1D data
+                if self.data.__class__.__name__ !="Data2D":
+                    if item in self.orientation_params:
+                        continue
+                if item in self.param_toFit:
+                    continue
+                ## hide statictext +/-    
+                if item[3]!=None and item[3].IsShown():
+                    item[3].Hide()
+                ## hide textcrtl  for error after fit
+                if item[4]!=None and item[4].IsShown():                   
+                    item[4].Hide()
+                    
+        if len(self.fittable_param)>0:
+            for item in self.fittable_param:
+                #Skip t ifhe angle parameters if 1D data
+                if self.data.__class__.__name__ !="Data2D":
+                    if item in self.orientation_params:
+                        continue
+                if item in self.param_toFit:
+                    continue
+                ## hide statictext +/-    
+                if item[3]!=None and item[3].IsShown():
+                    item[3].Hide()
+                ## hide textcrtl  for error after fit
+                if item[4]!=None and item[4].IsShown():
+                    item[4].Hide()
+        
+        return        
                 
         
@@ -742,6 +787,7 @@
         self.state.data= data 
         self._fill_datainfo_sizer()
-        self.SetScrollbars(20,20,25,65)
-        self.Layout()   
+
+        #self.SetScrollbars(20,20,25,65)
+        #self.Layout()   
         
     def reset_page(self, state,first=False):
@@ -749,18 +795,19 @@
             reset the state
         """
-
         self.reset_page_helper(state)
         import sans.guiframe.gui_manager
         evt = ModelEventbox(model=state.model)
-        wx.PostEvent(self.event_owner, evt)
-    
-        self.manager._on_change_engine(engine=self.engine_type)
-        
-        #self.state = self
+        wx.PostEvent(self.event_owner, evt)  
+   
+        if self.engine_type != None:
+            self.manager._on_change_engine(engine=self.engine_type)
+        #self.tcChi.SetLabel(str(format_number(self.tcChi.GetLabel())))  
+        # reset param_toFit   
+        self.select_param(event = None) 
+        #Save state_fit
         self.save_current_state_fit()
-        #self.set_model_param_sizer(model=state.model)
         self.Layout()
         self.Refresh()
-    
+        
     def get_range(self):
         """
@@ -796,14 +843,18 @@
        
         """
-        if out == None:
-            return
+        if out == None or not numpy.isfinite(chisqr):
+            raise ValueError,"Fit error occured..." 
+        
+        is_modified = False
+        has_error = False    
+        self._clear_Err_on_Fit()    
         #format chi2
         chi2 = format_number(chisqr)
-        
         self.tcChi.SetLabel(chi2)
         
-        is_modified = False
-        has_error = False
-        
+        #Hide error title
+        if self.text2_3.IsShown():
+            self.text2_3.Hide()
+      
         try:
             n = self.disp_box.GetCurrentSelection()
@@ -817,7 +868,7 @@
             pass
         #set the panel when fit result are float not list
+
         if out.__class__== numpy.float64:
             self.param_toFit[0][2].SetValue(format_number(out))
-            self.param_toFit[0][2].Refresh()
             
             if self.param_toFit[0][4].IsShown:
@@ -846,60 +897,57 @@
                     has_error = True
         else:
-           	
-            if self.text2_3.IsShown():
-                self.text2_3.Hide()
+
             i = 0
             #Set the panel when fit result are list
-            for item in self.param_toFit:           
-                ## reset error value to initial state
-                if item[3].IsShown():
-                    item[3].Hide()
-                if item[4].IsShown():
-                    item[4].Hide()
-                    
-                if len(out)<=len(self.param_toFit) and i < len(out):
-                    item[2].SetValue(format_number(self.model.getParam(item[1])))
-                    item[2].Refresh()                        
-                for ind in range(len(out)):
-                    
-                    if item[1] == p_name[ind]:
-                        break        
-
-
-                if(cov !=None)  and len(cov)<=len(self.param_toFit) and i < len(cov):
-                    try:
-                        name= dispersity.__name__
-                        if name == "GaussianDispersion":
-                            if hasattr(self,"text_disp_1" ):
-                                if self.text_disp_1!=None:
-                                    self.text_disp_1.Show(True)
-                    except:
-                        pass                   
-                    if cov[ind]==None or not numpy.isfinite(cov[ind]):
-
-                        if item[3].IsShown:
-                            item[3].Hide()
-                        if item[4].IsShown:
-                            item[4].Hide()             
-
-                    else:                        
-                        item[3].Show(True)
-                        item[3].Refresh()
-                        item[4].Show(True)
-                        item[4].SetValue(format_number(cov[ind]))
-                        item[4].Refresh()
-                        has_error = True
-        	    i += 1             
+            for item in self.param_toFit:      
+                if len(item)>5 and item != None:     
+                    ## reset error value to initial state
+                    if item[3].IsShown():
+                        item[3].Hide()
+                    if item[4].IsShown():
+                        item[4].Hide()
+  
+                    if len(out)<=len(self.param_toFit):# and i < len(out):
+                        val_out = format_number(self.model.getParam(item[1]))
+                        if item[2] != val_out:
+                            item[2].SetValue(val_out)
+                       
+                    for ind in range(len(out)):
+                        
+                        if item[1] == p_name[ind]:
+                            break        
+
+                    if(cov !=None) and len(cov)<=len(self.param_toFit):
+                        
+                        try:
+                            name= dispersity.__name__
+                            if name == "GaussianDispersion":
+                                if hasattr(self,"text_disp_1" ):
+                                    if self.text_disp_1!=None:
+                                        self.text_disp_1.Show(True)
+                        except:
+                            pass    
+                   
+                        if cov[ind]!=None and numpy.isfinite(cov[ind]):
+                            val_err = format_number(cov[ind])
+                            item[3].Show(True)
+                            item[4].Show(True)
+                            if val_err != item[4].GetValue():
+                                item[4].SetValue(format_number(cov[ind]))
+                            has_error = True
+            	    i += 1         
         #Show error title when any errors displayed
         if has_error: 
             if not self.text2_3.IsShown():
-                self.text2_3.Show(True)                            
-        ## save current state
-        self.save_current_state()
-
-        self.text2_3.Layout() 
-        self.sizer3.Layout()           
-        self.Layout()
-        self.Refresh()
+                self.text2_3.Show(True) 
+        try:      
+            ## save current state  
+            self.save_current_state() 
+            self.Layout()
+            self.Refresh()
+        except:
+            raise
+        self.btFit.SetFocus()  
+
 
     def onSmear(self, event):
@@ -943,9 +991,10 @@
             if output ==None:
                 output= "-"
+
             self.tcChi.SetLabel(str(format_number(output)))
            
             self.sizer5.Layout()
-            #self.sizer5.Refresh()
-            self.state.tcChi =output
+            self.sizer5.Refresh()
+            self.state.tcChi =self.tcChi
           
         except:
@@ -1094,4 +1143,8 @@
         self.param_toFit=[]
         for item in self.parameters:
+            #Skip t ifhe angle parameters if 1D data
+            if self.data.__class__.__name__ !="Data2D":
+                if item in self.orientation_params:
+                    continue
             #Select parameters to fit for list of primary parameters
             if item[0].GetValue():
@@ -1102,6 +1155,11 @@
                 if item in self.param_toFit:
                     self.param_toFit.remove(item)
+
         #Select parameters to fit for list of fittable parameters with dispersion          
         for item in self.fittable_param:
+            #Skip t ifhe angle parameters if 1D data
+            if self.data.__class__.__name__ !="Data2D":
+                if item in self.orientation_params:
+                    continue
             if item[0].GetValue():
                 if not (item in self.param_toFit):
@@ -1110,7 +1168,16 @@
                 #remove parameters from the fitting list
                 if item in self.param_toFit:
-                    self.param_toFit.remove(item)           
+                    self.param_toFit.remove(item)
+
+        #Calculate num. of angle parameters 
+        if self.data.__class__.__name__ =="Data2D":  
+            len_orient_para = 0
+        else:
+            len_orient_para = len(self.orientation_params)  #assume even len 
+        #Total num. of angle parameters
+        if len(self.fittable_param) > 0:
+            len_orient_para *= 2
         #Set the value of checkbox that selected every checkbox or not            
-        if len(self.parameters)+len(self.fittable_param) ==len(self.param_toFit):
+        if len(self.parameters)+len(self.fittable_param)-len_orient_para ==len(self.param_toFit):
             self.cb1.SetValue(True)
         else:
@@ -1247,5 +1314,5 @@
       
                 ctl4.Hide()
-                
+
                 if self.engine_type=="park":
                     ctl3.Show(True)
@@ -1339,9 +1406,9 @@
                     sizer.Add(ctl3, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
                     ctl3.Hide()
-                    if self.data.__class__.__name__ =="Data2D":
-                        ctl3.Show(True)
+                    #if self.data.__class__.__name__ =="Data2D":
+                    #    ctl3.Show(True)
                      
-                    else:
-                        ctl3.Hide()
+                    #else:
+                    #    ctl3.Hide()
                 
                     ix += 1
@@ -1353,14 +1420,6 @@
                    
                     ctl4.Hide()
-                    if self.data.__class__.__name__ =="Data2D":
-                        ctl4.Show(True)
-                  
-                    else:
-                        ctl4.Hide()
-                   
-                    if self.engine_type !="park" or self.data.__class__.__name__ !="Data2D":                      
-                        ctl3.Hide()
-                        ctl4.Hide()
-                    else:
+                    
+                    if self.engine_type =="park" and self.data.__class__.__name__ =="Data2D":                      
                         ctl3.Show(True)
                         ctl4.Show(True)
Index: sansview/perspectives/fitting/fitting.py
===================================================================
--- sansview/perspectives/fitting/fitting.py	(revision 464fce5460be391938ff4d356a01b8d6914cdf9b)
+++ sansview/perspectives/fitting/fitting.py	(revision edd166b7701db6213bf2eceec179494a8cda162e)
@@ -636,5 +636,5 @@
             msg= title +" error: %s" % sys.exc_value
             wx.PostEvent(self.parent, StatusEvent(status= msg, type="stop"))
-           
+            return
        
     def _onSelect(self,event):
@@ -769,5 +769,6 @@
                     model.setParam(name,result.pvec)
                 else:
-                    model.setParam(name,result.pvec[i])
+                    if result.pvec[i] != None and numpy.isfinite(result.pvec[i]):
+                        model.setParam(name,result.pvec[i])
                     i += 1
             ## Reset values of the current page to fit result
@@ -812,4 +813,5 @@
               
             for page, value in self.page_finder.iteritems():
+                """
                 if format_number(result.fitness) == page.get_chi2():
                     #ToDo: Compare parameter inputs with outputs too.
@@ -817,5 +819,6 @@
                     msg +=" but chi2 has not been improved..."
                     wx.PostEvent(self.parent, StatusEvent(status="%s " % msg)) 
-                    break                   
+                    break     
+                """              
                 if value.get_scheduled()==1:
                     model = value.get_model()
@@ -832,5 +835,6 @@
                             if p.name == p_name:
                                 small_out.append(p.value )
-                                model.setParam(param_name,p.value) 
+                                if p.value != None and numpy.isfinite(p.value):
+                                    model.setParam(param_name,p.value) 
                                 small_param_name.append(param_name)
                                 small_cov.append(p.stderr)
@@ -1243,5 +1247,4 @@
             @param model: the model to plot
         """
-         
         x=  numpy.linspace(start= qmin,
                            stop= qmax,
