diff --git a/src/Lib/terragear/tg_accumulator.cxx b/src/Lib/terragear/tg_accumulator.cxx
index 7a4adb1e..c28319d7 100644
--- a/src/Lib/terragear/tg_accumulator.cxx
+++ b/src/Lib/terragear/tg_accumulator.cxx
@@ -90,13 +90,13 @@ tgPolygon tgAccumulator::Diff( const tgPolygon& subject )
         all_nodes.add( nodes[i] );
     }
 
-    unsigned int  num_hits = 0;
     tgRectangle box1 = subject.GetBoundingBox();
 
     ClipperLib::Paths clipper_subject = tgPolygon::ToClipper( subject );
     ClipperLib::Paths clipper_result;
 
     while ( !done && max_hits > 0 ) {    
+        unsigned int  num_hits = 0;
         ClipperLib::Clipper c;
         c.Clear();
 
@@ -104,6 +104,10 @@ tgPolygon tgAccumulator::Diff( const tgPolygon& subject )
 
         // clip result against all polygons in the accum that intersect our bb
         for (unsigned int i=0; i < accum.size(); i++) {
+	    if (num_hits >= max_hits)
+	    {
+		break;
+	    }
             tgRectangle box2 = BoundingBox_FromClipper( accum[i] );
 
             if ( box2.intersects(box1) )
@@ -117,10 +121,7 @@ tgPolygon tgAccumulator::Diff( const tgPolygon& subject )
             if ( !c.Execute(ClipperLib::ClipType::Difference, clipper_result, ClipperLib::PolyFillType::NonZero, ClipperLib::PolyFillType::NonZero) ) {
                 SG_LOG(SG_GENERAL, SG_ALERT, "Diff With Accumulator returned FALSE - reducing accumulator" );
                 max_hits = num_hits-1;
-
-                FILE* fp = fopen( "./accumulator_fail.log", "a" );
-                fprintf( fp, "%s : reduce from %u to %u\n", debugstr.c_str(), num_hits, max_hits );
-                fclose(fp);                
+                SG_LOG(SG_GENERAL, SG_DEBUG, debugstr << ": reduce from " <<  num_hits << " to " << max_hits );
             } else {
                 result = tgPolygon::FromClipper( clipper_result );
                 result = tgPolygon::AddColinearNodes( result, all_nodes );
@@ -236,4 +237,4 @@ void tgAccumulator::ToClipperfiles( const std::string& path, const std::string&
             }
         }
     }
-}
\ No newline at end of file
+}