Index: sasmodels/models/barbell.c
===================================================================
--- sasmodels/models/barbell.c	(revision c138211ba5bc8b514509192d9e5287351eabf44b)
+++ sasmodels/models/barbell.c	(revision 3c97ff07f375d382f26608fa2873fc2ce6733fe0)
@@ -1,12 +1,14 @@
 double form_volume(double bell_radius, double radius, double length);
-double Iq(double q, double sld, double solvent_sld, double bell_radius, double radius, double length);
+double Iq(double q, double sld, double solvent_sld,
+        double bell_radius, double radius, double length);
 double Iqxy(double qx, double qy, double sld, double solvent_sld,
-    double bell_radius, double radius, double length, double theta, double phi);
+        double bell_radius, double radius, double length,
+        double theta, double phi);
 
 //barbell kernel - same as dumbell
 double _bell_kernel(double q, double h, double bell_radius,
-    double length, double sin_alpha, double cos_alpha);
+        double length, double sin_alpha, double cos_alpha);
 double _bell_kernel(double q, double h, double bell_radius,
-    double length, double sin_alpha, double cos_alpha)
+        double length, double sin_alpha, double cos_alpha)
 {
     const double upper = 1.0;
@@ -16,12 +18,9 @@
     for (int i = 0; i < 76; i++){
         const double t = 0.5*(Gauss76Z[i]*(upper-lower)+upper+lower);
-	    const double arg1 = q*cos_alpha*(bell_radius*t+h+length*0.5);
-	    const double arg2 = q*bell_radius*sin_alpha*sqrt(1.0-t*t);
-
+        const double arg1 = q*cos_alpha*(bell_radius*t+h+length*0.5);
+        const double arg2 = q*bell_radius*sin_alpha*sqrt(1.0-t*t);
         const double be = (arg2 == 0.0 ? 0.5 :J1(arg2)/arg2);
-
-	    const double Fq = cos(arg1)*(1.0-t*t)*be;
-
-	    total += Gauss76Wt[i] * Fq;
+        const double Fq = cos(arg1)*(1.0-t*t)*be;
+        total += Gauss76Wt[i] * Fq;
     }
     const double integral = 0.5*(upper-lower)*total;
@@ -44,8 +43,8 @@
 
 double Iq(double q, double sld,
-    double solvent_sld,
-    double bell_radius,
-    double radius,
-    double length)
+        double solvent_sld,
+        double bell_radius,
+        double radius,
+        double length)
 {
     double sn, cn; // slots to hold sincos function output
@@ -84,11 +83,11 @@
 
 double Iqxy(double qx, double qy,
-    double sld,
-    double solvent_sld,
-    double bell_radius,
-    double radius,
-    double length,
-    double theta,
-    double phi)
+        double sld,
+        double solvent_sld,
+        double bell_radius,
+        double radius,
+        double length,
+        double theta,
+        double phi)
 {
      double sn, cn; // slots to hold sincos function output
Index: sasmodels/models/cylinder.c
===================================================================
--- sasmodels/models/cylinder.c	(revision ef2861b72862333ff5d64d8382268fb4d25dec0c)
+++ sasmodels/models/cylinder.c	(revision 3c97ff07f375d382f26608fa2873fc2ce6733fe0)
@@ -33,9 +33,9 @@
         // translate a point in [-1,1] to a point in [lower,upper]
         //const double alpha = ( Gauss76Z[i]*(upper-lower) + upper + lower )/2.0;
-        const double alpha = 0.5*(Gauss76Z[i]*M_PI_2 + M_PI_2);
+        const double alpha = M_PI_4*(Gauss76Z[i] + 1.0);
         double sn, cn;
         SINCOS(alpha, sn, cn);
         // For a bit of efficiency, we are moving the 2 V delta rho constant
-        // factor, 2Vd, out of the loop, so this is fq/2Vd rather than fq.
+        // factor, 2Vdrho, out of the loop, so this is fq/2Vdrho rather than fq.
         const double fq = _cyl(qr*sn, qh*cn);
         total += Gauss76Wt[i] * fq * fq * sn;
@@ -43,6 +43,6 @@
     // translate dx in [-1,1] to dx in [lower,upper]
     //const double form = (upper-lower)/2.0*total;
-    const double twovd = 2.0*(sld-solvent_sld)*form_volume(radius, length);
-    return 1.0e-4 * twovd * twovd * total * M_PI_4;
+    const double twoVdrho = 2.0*(sld-solvent_sld)*form_volume(radius, length);
+    return 1.0e-4 * twoVdrho * twoVdrho * total * M_PI_4;
 }
 
