Index: sasmodels/generate.py
===================================================================
--- sasmodels/generate.py	(revision c4e321550a7eecc695933ac3c012bddd93f534d7)
+++ sasmodels/generate.py	(revision bb4b50990533a15ceda4443988db938e13a28a2b)
@@ -492,6 +492,7 @@
 
 def test_tag_float():
-
-    cases="""
+    """check that floating point constants are properly identified and tagged with 'f'"""
+
+    cases = """
 ZP  : 0.
 ZPF : 0.0,0.01,0.1
@@ -519,5 +520,5 @@
 """
 
-    output="""
+    output = """
 ZP  : 0.f
 ZPF : 0.0f,0.01f,0.1f
@@ -611,5 +612,7 @@
     # type: (str, List[Parameter]) -> List[str]
     """
-    Return a list of *prefix.parameter* from parameter items.
+    Return a list of *prefix+parameter* from parameter items.
+
+    *prefix* should be "v." if v is a struct.
     """
     return [p.as_call_reference(prefix) for p in pars]
@@ -733,5 +736,5 @@
         call_iqxy = "#define CALL_IQ(_q,_i,_v) Iq(%s)" % (",".join(pars_sqrt))
 
-    magpars = [k-2 for k,p in enumerate(partable.call_parameters)
+    magpars = [k-2 for k, p in enumerate(partable.call_parameters)
                if p.type == 'sld']
 
@@ -742,5 +745,5 @@
     source.append("#define NUM_MAGNETIC %d" % partable.nmagnetic)
     source.append("#define MAGNETIC_PARS %s"%",".join(str(k) for k in magpars))
-    for k,v in enumerate(magpars[:3]):
+    for k, v in enumerate(magpars[:3]):
         source.append("#define MAGNETIC_PAR%d %d"%(k+1, v))
 
@@ -779,5 +782,5 @@
         "#undef CALL_IQ",
         "#undef KERNEL_NAME",
-         ]
+    ]
 
     imagnetic = [
@@ -872,5 +875,5 @@
 
 # TODO: need a single source for rst_prolog; it is also in doc/rst_prolog
-RST_PROLOG = """\
+RST_PROLOG = r"""\
 .. |Ang| unicode:: U+212B
 .. |Ang^-1| replace:: |Ang|\ :sup:`-1`
Index: sasmodels/kernel_header.c
===================================================================
--- sasmodels/kernel_header.c	(revision b00a646c6ab83c01056acef9b46d1e392433af0b)
+++ sasmodels/kernel_header.c	(revision bb4b50990533a15ceda4443988db938e13a28a2b)
@@ -14,5 +14,5 @@
 #    define SINCOS(angle,svar,cvar) do {const double _t_=angle; svar=sin(_t_);cvar=cos(_t_);} while (0)
 #  endif
-   // Intel CPU on Mac gives strange values for erf(); also on the tested
+   // Intel CPU on Mac gives strange values for erf(); on the verified
    // platforms (intel, nvidia, amd), the cephes erf() is significantly
    // faster than that available in the native OpenCL.
@@ -57,5 +57,5 @@
          typedef int int32_t;
          #include <math.h>
-         // TODO: test isnan
+         // TODO: check isnan is correct
          inline double _isnan(double x) { return x != x; } // hope this doesn't optimize away!
          #undef isnan
Index: sasmodels/model_test.py
===================================================================
--- sasmodels/model_test.py	(revision 3330bb44faf647c84e605c5a75bed3f385a25a52)
+++ sasmodels/model_test.py	(revision bb4b50990533a15ceda4443988db938e13a28a2b)
@@ -85,5 +85,6 @@
         skip = []
     for model_name in models:
-        if model_name in skip: continue
+        if model_name in skip:
+            continue
         model_info = load_model_info(model_name)
 
@@ -239,5 +240,5 @@
             multiple = [test for test in self.info.tests
                         if isinstance(test[2], list)
-                            and not all(result is None for result in test[2])]
+                        and not all(result is None for result in test[2])]
             tests_has_1D_multiple = any(isinstance(test[1][0], float)
                                         for test in multiple)
@@ -262,4 +263,7 @@
             user_pars, x, y = test
             pars = expand_pars(self.info.parameters, user_pars)
+            invalid = invalid_pars(self.info.parameters, pars)
+            if invalid:
+                raise ValueError("Unknown parameters in test: " + ", ".join(invalid))
 
             if not isinstance(y, list):
@@ -305,4 +309,21 @@
 
     return ModelTestCase
+
+def invalid_pars(partable, pars):
+    # type: (ParameterTable, Dict[str, float])
+    """
+    Return a list of parameter names that are not part of the model.
+    """
+    names = set(p.id for p in partable.call_parameters)
+    invalid = []
+    for par in sorted(pars.keys()):
+        parts = par.split('_pd')
+        if len(parts) > 1 and parts[1] not in ("", "_n", "nsigma", "type"):
+            invalid.append(par)
+            continue
+        if parts[0] not in names:
+            invalid.append(par)
+    return invalid
+
 
 def is_near(target, actual, digits=5):
Index: sasmodels/modelinfo.py
===================================================================
--- sasmodels/modelinfo.py	(revision f88e2480698b5dcd90f16c16ecd9d445273a1b9a)
+++ sasmodels/modelinfo.py	(revision bb4b50990533a15ceda4443988db938e13a28a2b)
@@ -101,5 +101,5 @@
                 limits = (float(low), float(high))
             except Exception:
-                raise ValueError("invalid limits for %s: %r"%(name,user_limits))
+                raise ValueError("invalid limits for %s: %r"%(name, user_limits))
             if low >= high:
                 raise ValueError("require lower limit < upper limit")
@@ -342,4 +342,8 @@
     def as_call_reference(self, prefix=""):
         # type: (str) -> str
+        """
+        Return *prefix* + parameter name.  For struct references, use "v."
+        as the prefix.
+        """
         # Note: if the parameter is a struct type, then we will need to use
         # &prefix+id.  For scalars and vectors we can just use prefix+id.
@@ -420,5 +424,5 @@
         self.npars = sum(p.length for p in self.kernel_parameters)
         self.nmagnetic = sum(p.length for p in self.kernel_parameters
-                             if p.type=='sld')
+                             if p.type == 'sld')
         self.nvalues = 2 + self.npars
         if self.nmagnetic:
@@ -457,5 +461,5 @@
         self.has_2d = any(p.type in ('orientation', 'magnetic')
                           for p in self.kernel_parameters)
-        self.magnetism_index = [k for k,p in enumerate(self.call_parameters)
+        self.magnetism_index = [k for k, p in enumerate(self.call_parameters)
                                 if p.id.startswith('M0:')]
 
@@ -544,7 +548,7 @@
                               'magnetic', 'magnetic amplitude for '+p.description),
                     Parameter('mtheta:'+p.id, 'degrees', 0., [-90., 90.],
-                               'magnetic', 'magnetic latitude for '+p.description),
+                              'magnetic', 'magnetic latitude for '+p.description),
                     Parameter('mphi:'+p.id, 'degrees', 0., [-180., 180.],
-                               'magnetic', 'magnetic longitude for '+p.description),
+                              'magnetic', 'magnetic longitude for '+p.description),
                 ])
         #print("call parameters", full_list)
@@ -683,7 +687,7 @@
 
     if (model_info.Iq is None
-        and model_info.Iqxy is None
-        and model_info.Imagnetic is None
-        and model_info.form_volume is None):
+            and model_info.Iqxy is None
+            and model_info.Imagnetic is None
+            and model_info.form_volume is None):
         return
 
@@ -843,4 +847,8 @@
     #: it to False because they require double precision calculations.
     single = None           # type: bool
+    #: True if the model can be run as an opencl model.  If for some reason
+    #: the model cannot be run in opencl (e.g., because the model passes
+    #: functions by reference), then set this to false.
+    opencl = None           # type: bool
     #: True if the model is a structure factor used to model the interaction
     #: between form factor models.  This will default to False if it is not
Index: sasmodels/models/stacked_disks.py
===================================================================
--- sasmodels/models/stacked_disks.py	(revision 9802ab3945a154b871264715dcb463d4ec644afa)
+++ sasmodels/models/stacked_disks.py	(revision bb4b50990533a15ceda4443988db938e13a28a2b)
@@ -156,17 +156,17 @@
 qx = q*cos(pi/6.0)
 qy = q*sin(pi/6.0)
-tests = [
 # Accuracy tests based on content in test/utest_extra_models.py.
 # Added 2 tests with n_stacked = 5 using SasView 3.1.2 - PDB;
 # for which alas q=0.001 values seem closer to n_stacked=1 not 5,
 # changed assuming my 4.1 code OK, RKH
-    [{'thick_core': 10.0,
-      'thick_layer': 15.0,
-      'radius': 3000.0,
-      'n_stacking': 1.0,
-      'sigma_d': 0.0,
-      'sld_core': 4.0,
-      'sld_layer': -0.4,
-      'solvent_sd': 5.0,
+tests = [
+    [{'thick_core': 10.0,
+      'thick_layer': 15.0,
+      'radius': 3000.0,
+      'n_stacking': 1.0,
+      'sigma_d': 0.0,
+      'sld_core': 4.0,
+      'sld_layer': -0.4,
+      'sld_solvent': 5.0,
       'theta': 90.0,
       'phi': 0.0,
@@ -181,5 +181,5 @@
       'sld_core': 4.0,
       'sld_layer': -0.4,
-      'solvent_sd': 5.0,
+      'sld_solvent': 5.0,
       'theta': 90.0,
       'phi': 0.0,
@@ -196,10 +196,10 @@
       'sld_core': 4.0,
       'sld_layer': -0.4,
-      'solvent_sd': 5.0,
+      'sld_solvent': 5.0,
       'theta': 90.0,
       'phi': 20.0,
       'scale': 0.01,
-      'background': 0.001},
-      (qx, qy), 0.0491167089952  ],
+      'background': 0.001,
+     }, (qx, qy), 0.0491167089952],
     [{'thick_core': 10.0,
       'thick_layer': 15.0,
@@ -209,5 +209,5 @@
       'sld_core': 4.0,
       'sld_layer': -0.4,
-      'solvent_sd': 5.0,
+      'sld_solvent': 5.0,
       'theta': 90.0,
       'phi': 0.0,
@@ -225,5 +225,5 @@
       'sld_core': 4.0,
       'sld_layer': -0.4,
-      'solvent_sd': 5.0,
+      'sld_solvent': 5.0,
       'theta': 90.0,
       'phi': 0.0,
@@ -240,5 +240,5 @@
       'sld_core': 4.0,
       'sld_layer': -0.4,
-      'solvent_sd': 5.0,
+      'sld_solvent': 5.0,
       'theta': 90.0,
       'phi': 0.0,
@@ -253,19 +253,19 @@
       'sld_core': 4.0,
       'sld_layer': -0.4,
-      'solvent_sd': 5.0,
+      'sld_solvent': 5.0,
       'theta': 90.0,
       'phi': 20.0,
       'scale': 0.01,
       'background': 0.001,
-     }, (qx, qy), 0.0341738733124 ],
-
-    [{'thick_core': 10.0,
-      'thick_layer': 15.0,
-      'radius': 3000.0,
-      'n_stacking': 1.0,
-      'sigma_d': 0.0,
-      'sld_core': 4.0,
-      'sld_layer': -0.4,
-     'solvent_sd': 5.0,
+     }, (qx, qy), 0.0341738733124],
+
+    [{'thick_core': 10.0,
+      'thick_layer': 15.0,
+      'radius': 3000.0,
+      'n_stacking': 1.0,
+      'sigma_d': 0.0,
+      'sld_core': 4.0,
+      'sld_layer': -0.4,
+      'sld_solvent': 5.0,
       'theta': 90.0,
       'phi': 0.0,
@@ -275,3 +275,2 @@
     ]
 # 11Jan2017   RKH checking unit test agai, note they are all 1D, no 2D
-
Index: sasmodels/models/two_power_law.py
===================================================================
--- sasmodels/models/two_power_law.py	(revision 40a87fa5096610e24c3ead10299f609e99f093f2)
+++ sasmodels/models/two_power_law.py	(revision bb4b50990533a15ceda4443988db938e13a28a2b)
@@ -120,5 +120,5 @@
      }, 0.150141, 0.125945],
 
-    [{'coeffcent_1':    1.0,
+    [{'coefficent_1':    1.0,
       'crossover':  0.04,
       'power_1':    1.0,
@@ -127,5 +127,5 @@
      }, 0.442528, 0.00166884],
 
-    [{'coeffcent_1':    1.0,
+    [{'coefficent_1':    1.0,
       'crossover':  0.04,
       'power_1':    1.0,
