diff -urN povray-3.50c/src/fpmetric.cpp povray-3.50c-ww/src/fpmetric.cpp
--- povray-3.50c/src/fpmetric.cpp	2003-01-07 02:08:27.000000000 +0100
+++ povray-3.50c-ww/src/fpmetric.cpp	2003-06-28 10:35:35.000000000 +0200
@@ -14,9 +14,9 @@
  *  than those supported by the POV-Ray Team.  There are strict rules under
  *  which you are permitted to use this file.  The rules are in the file
  *  named POVLEGAL.DOC which should be distributed with this file.
-*  If POVLEGAL.DOC is not available it may be found online at -
-*
-*    http://www.povray.org/povlegal.html.
+ *  If POVLEGAL.DOC is not available it may be found online at -
+ *
+ *    http://www.povray.org/povlegal.html.
  *
  * This program is based on the popular DKB raytracer version 2.12.
  * DKBTrace was originally written by David K. Buck.
@@ -218,8 +218,12 @@
 		D[Z] = Ray->Direction[Z];
 	}
 
-	if (Depth1 == Depth2)
-		Depth1 = 0;
+	//if (Depth1 == Depth2)
+	if(fabs(Depth1-Depth2)<1e-10)
+		Depth1 = 0.0;
+
+	if (Depth1 < DEPTH_TOLERANCE)
+		Depth1 = DEPTH_TOLERANCE;
 
 	if ((Depth1 += 4 * Par->accuracy) > Depth2)
 		return false;
@@ -357,7 +361,7 @@
 		}
 
 		/* Z */
-		if ((SectorNum[i] < MaxPrecompZ) && (0 < SectorNum[i]))
+		if (SectorNum[i] < MaxPrecompZ)
 		{
 			low = PData->Low[2][SectorNum[i]];
 			hi = PData->Hi[2][SectorNum[i]];
@@ -428,6 +432,8 @@
 		else
 		{
 			/* 1 copy */
+			if(i>=31)
+			{  fprintf(stderr,"\n*** i-overflow. (FIXME!!) ***\n"); abort();  }
 			if ((SectorNum[i] *= 2) >= Max_intNumber)
 				SectorNum[i] = Max_intNumber;
 			SectorNum[i + 1] = SectorNum[i];

