Index: sansmodels/src/c_models/librefl.c
===================================================================
--- sansmodels/src/c_models/librefl.c	(revision 101065a9bd217be61773f8eba38d0c461efee3fd)
+++ sansmodels/src/c_models/librefl.c	(revision 1b758b3923d6276fef26b6ebade24f23120b0d17)
@@ -151,6 +151,5 @@
 // ind = x position: 0 to max
 // nu = max x to integration
-double err_mod_func(n_sub, ind, nu)
-	double n_sub,nu, ind;
+double err_mod_func(double n_sub, double ind, double nu)
 {
   double center, func;
@@ -177,6 +176,5 @@
 	return func;
 }
-double linearfunc(n_sub, ind, nu)
-	double n_sub,nu, ind;
+double linearfunc(double n_sub, double ind, double nu)
 {
   double bin_size, func;
@@ -192,6 +190,5 @@
 }
 // use the right hand side from the center of power func
-double power_r(n_sub, ind, nu)
-	double n_sub, nu, ind;
+double power_r(double n_sub, double ind, double nu)
 {
   double bin_size,func;
@@ -209,6 +206,5 @@
 }
 // use the left hand side from the center of power func
-double power_l(n_sub, ind, nu)
-	double n_sub, nu, ind;
+double power_l(double n_sub, double ind, double nu)
 {
   double bin_size, func;
@@ -226,6 +222,5 @@
 }
 // use 1-exp func from x=0 to x=1
-double exp_r(n_sub, ind, nu)
-	double n_sub, nu, ind;
+double exp_r(double n_sub, double ind, double nu)
 {
   double bin_size, func;
@@ -247,6 +242,5 @@
 
 // use the left hand side mirror image of exp func
-double exp_l(n_sub, ind, nu)
-	double n_sub, nu, ind;
+double exp_l(double n_sub, double ind, double nu)
 {
   double bin_size, func;
@@ -269,7 +263,5 @@
 // To select function called
 // At nu = 0 (singular point), call line function
-double intersldfunc(fun_type, n_sub, i, nu, sld_l, sld_r)
-	double n_sub, nu, sld_l, sld_r,i;
-	int fun_type;
+double intersldfunc(int fun_type, double n_sub, double i, double nu, double sld_l, double sld_r)
 {
 	double sld_i, func;
@@ -315,7 +307,5 @@
 
 // used by refl.c
-double interfunc(fun_type, n_sub, i, sld_l, sld_r)
-	double n_sub, sld_l, sld_r, i;
-	int fun_type;
+double interfunc(int fun_type, double n_sub, double i, double sld_l, double sld_r)
 {
 	double sld_i, func;
Index: sansmodels/src/python_wrapper/WrapperGenerator.py
===================================================================
--- sansmodels/src/python_wrapper/WrapperGenerator.py	(revision 101065a9bd217be61773f8eba38d0c461efee3fd)
+++ sansmodels/src/python_wrapper/WrapperGenerator.py	(revision 1b758b3923d6276fef26b6ebade24f23120b0d17)
@@ -323,12 +323,13 @@
                     (par, self.params[par])
 
-            param_str += "        // Initialize dispersion / averaging parameter dict\n"
-            param_str += "        DispersionVisitor* visitor = new DispersionVisitor();\n"
-            param_str += "        PyObject * disp_dict;\n"
-            for par in self.disp_params:
-                par = par.strip()
-                param_str += "        disp_dict = PyDict_New();\n"
-                param_str += "        self->model->%s.dispersion->accept_as_source(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par)
-                param_str += "        PyDict_SetItemString(self->dispersion, \"%s\", disp_dict);\n" % par
+            if len(self.disp_params)>0:
+                param_str += "        // Initialize dispersion / averaging parameter dict\n"
+                param_str += "        DispersionVisitor* visitor = new DispersionVisitor();\n"
+                param_str += "        PyObject * disp_dict;\n"
+                for par in self.disp_params:
+                    par = par.strip()
+                    param_str += "        disp_dict = PyDict_New();\n"
+                    param_str += "        self->model->%s.dispersion->accept_as_source(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par)
+                    param_str += "        PyDict_SetItemString(self->dispersion, \"%s\", disp_dict);\n" % par
                 
             # Initialize dispersion object dictionnary
@@ -345,11 +346,12 @@
                     (par, par)
                     
-            param_str += "    // Read in dispersion parameters\n"
-            param_str += "    PyObject* disp_dict;\n"
-            param_str += "    DispersionVisitor* visitor = new DispersionVisitor();\n"
-            for par in self.disp_params:
-                par = par.strip()
-                param_str += "    disp_dict = PyDict_GetItemString(self->dispersion, \"%s\");\n" % par
-                param_str += "    self->model->%s.dispersion->accept_as_destination(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par)
+            if len(self.disp_params)>0:
+                param_str += "    // Read in dispersion parameters\n"
+                param_str += "    PyObject* disp_dict;\n"
+                param_str += "    DispersionVisitor* visitor = new DispersionVisitor();\n"
+                for par in self.disp_params:
+                    par = par.strip()
+                    param_str += "    disp_dict = PyDict_GetItemString(self->dispersion, \"%s\");\n" % par
+                    param_str += "    self->model->%s.dispersion->accept_as_destination(visitor, self->model->%s.dispersion, disp_dict);\n" % (par, par)
                 
             newline = self.replaceToken(newline, "[READDICTIONARY]", param_str)
