Index: tol/bmath/bprdist/prd.cpp
===================================================================
--- tol/bmath/bprdist/prd.cpp	(revision dbf50f65d993aff72dc60cc4b22f2533930dc264)
+++ tol/bmath/bprdist/prd.cpp	(revision b3404fe68ba424969d6d42b904f50cf5f29fcbe5)
@@ -35,4 +35,5 @@
 #include <gsl/gsl_sf_result.h>
 #include <gsl/gsl_sf_gamma.h>
+#include <../../contrib/kmlocal/KMrand.h>	
 
 BTraceInit("prd.cpp");
@@ -120,4 +121,5 @@
 {
   InitGSLRand(seed);
+  kmInitialice(seed);
 };
 
Index: tol/contrib/kmlocal/KMrand.cpp
===================================================================
--- tol/contrib/kmlocal/KMrand.cpp	(revision dbf50f65d993aff72dc60cc4b22f2533930dc264)
+++ tol/contrib/kmlocal/KMrand.cpp	(revision b3404fe68ba424969d6d42b904f50cf5f29fcbe5)
@@ -44,19 +44,12 @@
 //	to initialise or reinitialise the sequence.
 //------------------------------------------------------------------------
-
-static double kmRan0()
-{
-    int j;
+void kmInitialice(int seed)
+{
+      int j;
 
     static double y, maxran, v[98];	// The exact number 98 is unimportant
-    static int iff = 0;
-
-    // As a precaution against misuse, we will always initialize on the first
-    // call, even if "kmIdum" is not set negative. Determine "maxran", the
-    // next integer after the largest representable value of type int. We
-    // assume this is a factor of 2 smaller than the corresponding value of
-    // type unsigned int. 
-
-    if (kmIdum < 0 || iff == 0) {	// initialize
+
+  	kmIdum = seed;
+
 		/* compute maximum random number */
 #ifdef WIN32				// Microsoft Visual C++
@@ -71,8 +64,6 @@
 	maxran = (double) k;
 #endif
- 	iff = 1;
-  
+
 	srandom(kmIdum);
-	kmIdum = 1;
 
 	for (j = 1; j <= 97; j++)	// exercise the system routine
@@ -82,5 +73,13 @@
 	    v[j] = random();
 	y = random();
-     }
+}
+
+
+
+static double kmRan0()
+{
+    int j;
+
+    static double y, maxran, v[98];	// The exact number 98 is unimportant
 
     // This is where we start if not initializing. Use the previously saved
Index: tol/contrib/kmlocal/KMrand.h
===================================================================
--- tol/contrib/kmlocal/KMrand.h	(revision dbf50f65d993aff72dc60cc4b22f2533930dc264)
+++ tol/contrib/kmlocal/KMrand.h	(revision b3404fe68ba424969d6d42b904f50cf5f29fcbe5)
@@ -37,4 +37,6 @@
 //  External entry points
 //----------------------------------------------------------------------
+
+void kmInitialice(int seed);
 
 int kmRanInt(			// random integer
