diff -ruN klic-3.003-2002-02-24c/include/klic/gg_macro.h klic-3.003-2002-02-25/include/klic/gg_macro.h
--- klic-3.003-2002-02-24c/include/klic/gg_macro.h	Sun Feb 24 13:16:34 2002
+++ klic-3.003-2002-02-25/include/klic/gg_macro.h	Mon Feb 25 11:00:16 2002
@@ -154,10 +154,10 @@
 #define GGSET_NEWOBJ_FOR_NEW(newgobj, type) \
 do{ \
   q res; \
-  set_heapp(g_allocp); \
+  assert(g_allocp == heapp()); \
   G_HEAPALLOC_WITH_CHECK((newgobj), GG_OBJ_SIZE, type, res); \
-  assert(res==GENERIC_GCREQUEST || \
-        (res==GENERIC_SUCCEEDED && g_allocp >= heapp()+GG_OBJ_SIZE) ); \
+  assert((res==GENERIC_GCREQUEST && g_allocp == heapp()) || \
+         (res==GENERIC_SUCCEEDED && g_allocp == heapp()+GG_OBJ_SIZE) ); \
   if(GG_GCREQUEST == res) { \
     q var; \
     struct goalrec *goal; \
@@ -171,7 +171,7 @@
 
 #define GG_RETURN_FROM_NEW(var) \
 do{ \
-  set_heapp(g_allocp); \
+  assert(g_allocp == heapp()); \
   return (var); \
 }while(0)
 
@@ -227,7 +227,7 @@
 #define GG_RETURN_FROM_GC(newgobj) \
 do{ \
   gcsp  = g_sp; \
-  set_heapp(g_allocp); \
+  assert(g_allocp == heapp()); \
   return(((q *)(newgobj))); \
 }while(0)
 
diff -ruN klic-3.003-2002-02-24c/runtime/cntlmsg.c klic-3.003-2002-02-25/runtime/cntlmsg.c
--- klic-3.003-2002-02-24c/runtime/cntlmsg.c	Fri Jan 25 23:29:15 2002
+++ klic-3.003-2002-02-25/runtime/cntlmsg.c	Mon Feb 25 10:47:17 2002
@@ -4,6 +4,8 @@
 %   (C)1996, 1997, 1998, 1999 Japan Information Processing Development Center
 %       (Read COPYRIGHT-JIPDEC for detailed information.)
 ----------------------------------------------------------- */
+
+#include <assert.h>
 #include <klic/basic.h>  /* fatal */
 #include <klic/struct.h>
 #include <klic/primitives.h>  /* enqueue_goal */
@@ -234,6 +236,7 @@
     generic_arg[2] = makeint(wec);   /* WEC */
   
     new_generic(reply_hook_g_new, 3, rhook, 0);
+    assert(allocp == heapp());
     
     allocp = do_unify(allocp ,rhook, data);
     return(allocp);
diff -ruN klic-3.003-2002-02-24c/runtime/datamsg.c klic-3.003-2002-02-25/runtime/datamsg.c
--- klic-3.003-2002-02-24c/runtime/datamsg.c	Fri Feb  8 15:40:09 2002
+++ klic-3.003-2002-02-25/runtime/datamsg.c	Mon Feb 25 10:48:23 2002
@@ -16,6 +16,7 @@
   decode funct			static q* decode_funct(inbuf, allocp)
   */
 
+#include <assert.h>
 #include <klic/basic.h>  /* fatal */
 #include <klic/struct.h>
 #include <klic/primitives.h>
@@ -97,6 +98,7 @@
     generic_arg[2] = makeint(GET_BUFFER(inbuf));  /* WEC */
 
     new_generic(exref_g_new, 3L, decode_data, 0);
+    assert(allocp == heapp());
     push_decode_stack(decode_data);
     return allocp;
   }
diff -ruN klic-3.003-2002-02-24c/runtime/ge_exref.c klic-3.003-2002-02-25/runtime/ge_exref.c
--- klic-3.003-2002-02-24c/runtime/ge_exref.c	Sun Feb 24 13:20:17 2002
+++ klic-3.003-2002-02-25/runtime/ge_exref.c	Mon Feb 25 11:00:18 2002
@@ -48,6 +48,7 @@
 
   allocp = g_allocp;                    /* Using allocp in 'new_generic' */
   new_generic(read_hook_g_new, 3, rdhok, 0);
+  assert(allocp == heapp());
   g_allocp = allocp;                    /* Using allocp in 'new_generic' */
 
   GG_SELF->method_table = 0;
@@ -153,6 +154,7 @@
   GG_SELF->gc_flag = IMPREC_COPIED;
   newself->gc_flag = IMPREC_NOT_COPIED;
 
+  set_heapp(g_allocp);
   GG_RETURN_FROM_GC(newself);
 }
 
@@ -172,7 +174,9 @@
   GG_STD_DECL_FOR_NEW;
   GG_OBJ_TYPE* new_exref;
 
+  set_heapp(g_allocp);
   GGSET_NEWOBJ_FOR_NEW(new_exref, (struct exref_object*));
+  assert(g_allocp == heapp() + GG_OBJ_SIZE);
 
   new_exref->node  = (long) intval(GG_ARGV[0]);
   new_exref->index = (long) intval(GG_ARGV[1]);
@@ -184,6 +188,7 @@
 
   regist_imp_entry(new_exref);
 
+  set_heapp(g_allocp);
   GG_RETURN_FROM_NEW(new_exref->to_exref);
 }
 
diff -ruN klic-3.003-2002-02-24c/runtime/random.c klic-3.003-2002-02-25/runtime/random.c
--- klic-3.003-2002-02-24c/runtime/random.c	Tue Feb 19 13:59:14 2002
+++ klic-3.003-2002-02-25/runtime/random.c	Mon Feb 25 11:00:19 2002
@@ -119,13 +119,16 @@
     fatalf("Invalid first argument (%d) in creation of random number generator",
 	   range);
   }
+  set_heapp(g_allocp);
   GGSET_NEWOBJ_FOR_NEW(obj, (GG_OBJ_TYPE*));
+  assert(g_allocp == heapp() + GG_OBJ_SIZE);
 
   obj->state[0] = seed >> (sizeof(seed)*4);
   obj->state[1] = seed >> (sizeof(seed)*2);
   obj->state[2] = seed >> (sizeof(seed)*0);
   obj->range = range;
   obj->max = ((((unsigned long)(~0))<<1)>>1)/range*range;
+  set_heapp(g_allocp);
   GG_RETURN_FROM_NEW(GG_MAKE_HOOK_VAR(obj));
 }
 #endif  /* NRAND48 */
