--- a/classic-bugs/vol1/litters/litters.bug
+++ b/classic-bugs/vol1/litters/litters.bug
@@ -2,6 +2,12 @@
   Beta-binomial model for litters data.
   Approximate uniform shrinkage prior
   with uniform prior for mu
+
+  We need to truncate the beta distribution of p[i] to avoid a
+  singularity at 1 when b[i] < 1.  This slows down the calculation
+  considerably as it requires calculation of the incomplete beta
+  function.
+
 */
 model {
   for (i in 1:G)
@@ -9,7 +15,7 @@
      for (j in 1:N)
      {
         r[i,j] ~ dbin(p[i,j], n[i,j]);
-        p[i,j] ~ dbeta(a[i], b[i]); 
+        p[i,j] ~ dbeta(a[i], b[i]) T(,0.9999); 
      }
 
      a[i] <- nbar[i] * mu[i] * phi[i];