diff -ruN klic-3.003-2002-03-19/include/klic/control.h klic-3.003-2002-03-19a/include/klic/control.h
--- klic-3.003-2002-03-19/include/klic/control.h	Tue Mar 12 12:08:47 2002
+++ klic-3.003-2002-03-19a/include/klic/control.h	Tue Mar 19 18:21:24 2002
@@ -91,7 +91,6 @@
 #define loop_within_module(f)				\
 do{ \
   module (*func)(); \
-  set_heapp(allocp); \
   _INC_REDUCTION_COUNT(REDUCTION_COUNTS); \
   if (heapp() >= heaplimit) { \
     klic_interrupt(qp); \
@@ -108,7 +107,6 @@
 
 #define execute(label) \
 do{ \
-  set_heapp(allocp); \
   _INC_REDUCTION_COUNT(500); \
   if (heapp() < heaplimit) goto label; \
 }while(0)
@@ -126,7 +124,6 @@
  */
 #define throw_goal(node, oldqp, goal) \
 do{ \
-  set_heapp(allocp); \
   qp = enqueue_throw_goal((node), (struct goalrec*) (goal), \
     (struct goalrec*) (oldqp)); \
 }while(0)
diff -ruN klic-3.003-2002-03-19/include/klic/g_basic.h klic-3.003-2002-03-19a/include/klic/g_basic.h
--- klic-3.003-2002-03-19/include/klic/g_basic.h	Mon Mar 11 17:04:06 2002
+++ klic-3.003-2002-03-19a/include/klic/g_basic.h	Tue Mar 19 18:21:24 2002
@@ -128,13 +128,8 @@
   G_PUSH_GOAL(goal)
 
 
-/*
-  deta flag for Object Table
-*/
-
-#define G_DATA 0
-#define G_CONSUMER 1
-#define G_GENERATOR 2
+/* deta flag for Object Table */
+enum g_type { G_DATA, G_CONSUMER, G_GENERATOR };
 
 /*
   external functions
diff -ruN klic-3.003-2002-03-19/include/klic/g_extern.h klic-3.003-2002-03-19a/include/klic/g_extern.h
--- klic-3.003-2002-03-19/include/klic/g_extern.h	Tue Mar  5 12:09:20 2002
+++ klic-3.003-2002-03-19a/include/klic/g_extern.h	Tue Mar 19 18:21:24 2002
@@ -20,7 +20,4 @@
 /* runtime/gen.c */
 extern struct predicate predicate_generic_xnew_3;
 
-extern struct predicate predicate_generic_xroot_4;
-extern struct predicate predicate_generic_xmethod_4;
-
 #endif /* _KLIC_G_EXTERN_H_ */
diff -ruN klic-3.003-2002-03-19/include/klic/gc_macro.h klic-3.003-2002-03-19a/include/klic/gc_macro.h
--- klic-3.003-2002-03-19/include/klic/gc_macro.h	Mon Mar 11 17:06:46 2002
+++ klic-3.003-2002-03-19a/include/klic/gc_macro.h	Tue Mar 19 18:21:24 2002
@@ -17,7 +17,6 @@
 extern void do_shallow_unify(q x, q y);
 extern void do_shallow_unify_value(q x, q y);
 extern void set_rest_of_stream(q term);
-extern void set_method_result(q term);
 
 /* runtime/generic.c */
 extern void G_SUSPEND(q x, struct goalrec* goal);
@@ -39,19 +38,15 @@
 #define    GC_FAIL(errmsg)    fatal(errmsg)
 #define	   GC_ERROR_IN_NEW(errmsg) \
   G_error((errmsg), "creation", "consumer", GC_CLASS_NAME_STRING)
-#define    GC_SUCCEEDED       GENERIC_SUCCEEDED
-#define    GC_GCREQUEST       GENERIC_GCREQUEST
 
 #define    GC_RETURN_WITH_HOOK(x) \
 do{ \
-  set_method_result(GC_SUCCEEDED); \
   set_rest_of_stream(x); \
   return; \
 }while(0)
 
 #define GC_TERMINATE \
 do{ \
-  set_method_result(GC_SUCCEEDED); \
   set_rest_of_stream(NULL); \
   return; \
 }while(0)
@@ -60,7 +55,6 @@
 do{ \
   q newvar, tmp; \
   q argv[2]; \
-  set_method_result(GC_SUCCEEDED); \
   G_MAKE_VAR(newvar); \
   set_rest_of_stream(newvar); \
   argv[0] = GC_TERM; \
@@ -102,7 +96,7 @@
 do{ \
   q res; \
   G_HEAPALLOC_WITH_CHECK((new), (size), type, res); \
-  if (GC_GCREQUEST == res) goto gc_request; \
+  if (res == GENERIC_GCREQUEST) goto gc_request; \
 }while(0)
 
 
@@ -160,7 +154,7 @@
 do{ \
   q res; \
   G_HEAPALLOC_WITH_CHECK((newgobj), (size), (GC_OBJ_TYPE*), res); \
-  if(GC_GCREQUEST == res){ \
+  if(res == GENERIC_GCREQUEST){ \
     q var; \
     struct goalrec *goal; \
     G_MAKE_THE_NEW_GOAL(&var, &goal, g_myself, GC_ARGC, GC_ARGV); \
diff -ruN klic-3.003-2002-03-19/include/klic/gd_macro.h klic-3.003-2002-03-19a/include/klic/gd_macro.h
--- klic-3.003-2002-03-19/include/klic/gd_macro.h	Tue Mar 19 14:24:44 2002
+++ klic-3.003-2002-03-19a/include/klic/gd_macro.h	Tue Mar 19 18:25:09 2002
@@ -55,29 +55,23 @@
 #define GD_ERROR_IN_METHOD(errmsg, methodname) \
   G_error((errmsg), (methodname), "data", GD_CLASS_NAME_STRING)
 
-#define GD_RETURN  do{ return heapp(); }while(0)
-#define GD_GCREQUEST GENERIC_GCREQUEST
-
-#define GD_GSUCCESS  ((long) GENERIC_SUCCEEDED)
-#define GD_GFAILURE  ((long) GENERIC_FAILED)
-
 #define GD_GRETURN(x)  do{ return (q) (x); }while(0)
 
 #define GD_GUNIFY_FAIL GD_GFAIL
-#define GD_GFAIL  do{ return (q) GD_GFAILURE; }while(0)
-#define GD_GSUCCEED  do{ return (q) GD_GSUCCESS; }while(0)
+#define GD_GFAIL  do{ return GENERIC_FAILED; }while(0)
+#define GD_GSUCCEED  do{ return GENERIC_SUCCEEDED; }while(0)
 
 /**************************************************/
 #define GD_ALLOC_AREA(new,type,size) \
 do{ \
   q res; \
   G_HEAPALLOC_WITH_CHECK((new), (size), type, res); \
-  if(GD_GCREQUEST == res){ \
+  if(res == GENERIC_GCREQUEST){ \
     struct goalrec *goal; \
     GD_MAKE_GENERIC_GOAL(&goal, makefunctor(GD_SELF), g_method_functor, \
 			   GD_ARGV); \
     G_PUSH_GOAL(goal); \
-    GD_RETURN; \
+    return; \
   } \
 }while(0)
 
@@ -85,7 +79,7 @@
 do{ \
   q res; \
   G_HEAPALLOC_WITH_CHECK((new), (size), type, res); \
-  if(GD_GCREQUEST == res){ \
+  if(res == GENERIC_GCREQUEST){ \
     q var; \
     struct goalrec *goal; \
     G_MAKE_THE_NEW_GOAL(&var, &goal, g_myself, GD_ARGC, GD_ARGV); \
@@ -100,7 +94,7 @@
 do{ \
   q res; \
   G_HEAPALLOC_WITH_CHECK((newgobj), (size), (GD_OBJ_TYPE*), res); \
-  if(GENERIC_GCREQUEST == res){ \
+  if(res == GENERIC_GCREQUEST){ \
     q var; \
     struct goalrec *goal; \
     G_MAKE_THE_NEW_GOAL(&var, &goal, g_myself, GD_ARGC, GD_ARGV); \
@@ -115,12 +109,12 @@
   q res; \
   G_HEAPALLOC_WITH_CHECK((newgobj), GD_OBJ_SIZE(GD_SELF), \
 			 (GD_OBJ_TYPE*), res); \
-  if (GD_GCREQUEST == res) { \
+  if (res == GENERIC_GCREQUEST) { \
     struct goalrec *goal; \
     GD_MAKE_GENERIC_GOAL(&goal, makefunctor(GD_SELF), \
 			   g_method_functor, GD_ARGV ); \
     G_PUSH_GOAL(goal); \
-    GD_RETURN; \
+    return; \
   } \
   (newgobj)->method_table = GD_SELF->method_table; \
 }while(0)
@@ -167,7 +161,7 @@
 	  GD_MAKE_GENERIC_GOAL(&goal, makefunctor(GD_SELF), \
 				 g_method_functor, GD_ARGV ); \
           G_SUSPEND((x), goal); \
-          GD_RETURN; \
+          return; \
 	} else { \
 	  (x) = temp0; \
 	} \
diff -ruN klic-3.003-2002-03-19/include/klic/gg_macro.h klic-3.003-2002-03-19a/include/klic/gg_macro.h
--- klic-3.003-2002-03-19/include/klic/gg_macro.h	Mon Mar 11 17:10:45 2002
+++ klic-3.003-2002-03-19a/include/klic/gg_macro.h	Tue Mar 19 18:21:24 2002
@@ -38,8 +38,6 @@
 #define GG_CLASS_NAME_STRING G_stringify(GG_CLASS_NAME())
 
 #define GG_FAIL(errmsg) fatal(errmsg)
-#define GG_GCREQUEST GENERIC_GCREQUEST
-#define GG_RETURN  do{ return heapp(); }while(0)
 
 #define GG_TERMINATE  do{ return !0; }while(0)
 
@@ -149,7 +147,7 @@
 do{ \
   q res; \
   G_HEAPALLOC_WITH_CHECK((newgobj), GG_OBJ_SIZE, type, res); \
-  if(GG_GCREQUEST == res) { \
+  if(res == GENERIC_GCREQUEST) { \
     q var; \
     struct goalrec *goal; \
     G_MAKE_THE_NEW_GOAL(&var, &goal, g_myself, GG_ARGC, GG_ARGV); \
diff -ruN klic-3.003-2002-03-19/runtime/gcode.c klic-3.003-2002-03-19a/runtime/gcode.c
--- klic-3.003-2002-03-19/runtime/gcode.c	Mon Mar 11 17:37:09 2002
+++ klic-3.003-2002-03-19a/runtime/gcode.c	Tue Mar 19 18:21:24 2002
@@ -70,7 +70,6 @@
   G_STD_DECL;
 
   GD_UNIFY(GD_ARGV[0], GD_SELF->module_obj);
-  GD_RETURN;
 }
 
 GDDEF_METHOD(name_1)
@@ -78,7 +77,6 @@
   G_STD_DECL;
 
   GD_UNIFY(GD_ARGV[0], GD_SELF->predicate_name);
-  GD_RETURN;
 }
 
 GDDEF_METHOD(arity_1)
@@ -87,7 +85,6 @@
   const struct predicate* pred = GD_SELF->pdesc;
 
   GD_UNIFY(GD_ARGV[0], makeint(pred->arity));
-  GD_RETURN;
 }
 
 #define GD_ALLOC_GOAL(goal, pdesc, size) \
@@ -125,7 +122,6 @@
     GD_GOAL_ARG(i, goal) = argv[1];
   }
   G_PUSH_GOAL(goal);
-  GD_RETURN;
 }
 
 #define GD_METHOD_ARITY  arities (g_method_functor)
@@ -142,7 +138,6 @@
     GD_GOAL_ARG(i, goal) = GD_ARGV[i];
   }
   G_PUSH_GOAL(goal);
-  GD_RETURN;
 }
 
 GDDEF_GENERIC()
diff -ruN klic-3.003-2002-03-19/runtime/generic.c klic-3.003-2002-03-19a/runtime/generic.c
--- klic-3.003-2002-03-19/runtime/generic.c	Tue Mar 19 14:30:37 2002
+++ klic-3.003-2002-03-19a/runtime/generic.c	Tue Mar 19 18:21:24 2002
@@ -92,7 +92,7 @@
       struct goalrec* goal; \
       GD_MAKE_GENERIC_GOAL(&goal, (obj), g_method_functor, g_argv); \
       G_SUSPEND((obj), goal); \
-      GD_RETURN; \
+      return; \
     }else{ \
       (obj) = temp0; \
     } \
diff -ruN klic-3.003-2002-03-19/runtime/gfloat.c klic-3.003-2002-03-19a/runtime/gfloat.c
--- klic-3.003-2002-03-19/runtime/gfloat.c	Tue Mar 19 14:08:00 2002
+++ klic-3.003-2002-03-19a/runtime/gfloat.c	Tue Mar 19 18:21:24 2002
@@ -107,7 +107,6 @@
   }
   str = convert_c_string_to_klic_string(buf);
   GD_UNIFY_VALUE(GD_ARGV[0], str);
-  GD_RETURN;
 }
 
 GDDEF_METHOD(int_1)
@@ -116,7 +115,6 @@
   double value = GD_SELF->value;
   q result = makeint((long) value);
   GD_UNIFY_VALUE(GD_ARGV[0], result);
-  GD_RETURN;
 }
 
 static double
diff -ruN klic-3.003-2002-03-19/runtime/ggoal.c klic-3.003-2002-03-19a/runtime/ggoal.c
--- klic-3.003-2002-03-19/runtime/ggoal.c	Tue Mar 12 12:08:47 2002
+++ klic-3.003-2002-03-19a/runtime/ggoal.c	Tue Mar 19 18:21:24 2002
@@ -143,7 +143,6 @@
 {
   G_STD_DECL;
   resume_same_prio(GD_SELF->goal);
-  GD_RETURN;
 }
 
 GDDEF_METHOD(step_4)
@@ -158,7 +157,6 @@
   newgoal->args[3] = GD_ARGV[2]; /* failure info */
   newgoal->args[4] = GD_ARGV[3]; /* suspension reason info */
   resume_same_prio(newgoal);
-  GD_RETURN;
 }
 
 GDDEF_METHOD(arg_2)
@@ -174,7 +172,6 @@
   the_arg = goal->args[position-1];
 
   GD_UNIFY(GD_ARGV[1], the_arg);
-  GD_RETURN;
 }
 
 GDDEF_METHOD(setarg_4)
@@ -205,7 +202,6 @@
 
   GD_UNIFY(GD_ARGV[1], oldarg);
   GD_UNIFY_VALUE(GD_ARGV[3], GD_OBJ(newobj));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(id_1)
@@ -215,7 +211,6 @@
 
   id = GD_SELF->id;
   GD_UNIFY_VALUE(GD_ARGV[0], makeint(id));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(predicate_4)
@@ -228,7 +223,6 @@
   GD_UNIFY_VALUE(GD_ARGV[1], pte->name);
   GD_UNIFY_VALUE(GD_ARGV[2], makeint(pte->pred->arity));
   GD_UNIFY_VALUE(GD_ARGV[3], makeint((unsigned long)(pte->pred)>>2));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(set__predicate_2)
@@ -268,7 +262,6 @@
   newobj->goal = newgoal;
 
   GD_UNIFY_VALUE(GD_ARGV[1], GD_OBJ(newobj));
-  GD_RETURN;
 }
 
 /*  Generic Method Table */
diff -ruN klic-3.003-2002-03-19/runtime/gmodule.c klic-3.003-2002-03-19a/runtime/gmodule.c
--- klic-3.003-2002-03-19/runtime/gmodule.c	Mon Mar 11 17:33:29 2002
+++ klic-3.003-2002-03-19a/runtime/gmodule.c	Tue Mar 19 18:21:24 2002
@@ -70,7 +70,6 @@
 {
   G_STD_DECL;
   GD_UNIFY( GD_ARGV[0],GD_SELF->name);
-  GD_RETURN;
 }
 
 
diff -ruN klic-3.003-2002-03-19/runtime/gmvv.c klic-3.003-2002-03-19a/runtime/gmvv.c
--- klic-3.003-2002-03-19/runtime/gmvv.c	Tue Mar 19 14:08:36 2002
+++ klic-3.003-2002-03-19a/runtime/gmvv.c	Tue Mar 19 18:21:24 2002
@@ -97,9 +97,9 @@
     Shallow(GD_SELF);
     retval = GD_GUNIFY(GD_SELF->body[k], x);
     switch ((long)retval) {
-    case GD_GSUCCESS:
+    case GENERIC_SUCCEEDED:
       break;
-    case GD_GFAILURE:
+    case GENERIC_FAILED:
       GD_GUNIFY_FAIL;
       break;
     default:
@@ -185,7 +185,7 @@
   PUT_BUFFER(buffer, decode_vector);
   PUT_BUFFER(buffer, size);
 
-  return(GENERIC_SUCCEEDED);
+  return GENERIC_SUCCEEDED;
 }
 #endif /* DIST */
 
@@ -198,7 +198,6 @@
   Shallow(GD_SELF);
   GDSET_INTARG_WITHIN_RANGE(position,GD_ARGV[0],0,GD_SELF->index);
   GD_UNIFY(GD_ARGV[1], GD_SELF->body[position]);
-  GD_RETURN;
 }
 
 GDDEF_METHOD(size_1)
@@ -206,7 +205,6 @@
   G_STD_DECL;
   Shallow(GD_SELF);
   GD_UNIFY_VALUE(GD_ARGV[0], G_MAKEINT(GD_SELF->index));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(set__element_3)
@@ -244,7 +242,6 @@
   newvect->index = size;
   newvect->iscnst = 0;
   GD_UNIFY_VALUE(GD_ARGV[2], GD_OBJ(newvect));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(set__element_4)
@@ -284,7 +281,6 @@
   newvect->index = size;
   newvect->iscnst = 0;
   GD_UNIFY_VALUE(GD_ARGV[3], GD_OBJ(newvect));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(split_3)
@@ -315,7 +311,6 @@
   upper->iscnst = lower->iscnst = 0;
   GD_UNIFY_VALUE(GD_ARGV[1],G_MAKEFUNCTOR(upper));
   GD_UNIFY_VALUE(GD_ARGV[2],G_MAKEFUNCTOR(lower));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(join_2)
@@ -350,7 +345,6 @@
   new->body = newbody;
   new->iscnst = 0;
   GD_UNIFY_VALUE(GD_ARGV[1],G_MAKEFUNCTOR(new));
-  GD_RETURN;
 }
 
 /*  Generic Method Table */
@@ -582,31 +576,20 @@
   long size, k;
   q res;
 
-  /* GDSET_NEWOBJ_FOR_NEW(newvect, G_SIZE_IN_Q(GD_OBJ_TYPE)); */
   G_HEAPALLOC_WITH_CHECK(newvect, G_SIZE_IN_Q(GD_OBJ_TYPE),
                           (GD_OBJ_TYPE*), res);
-  /* G_HEAPALLOC(newvect, G_SIZE_IN_Q(GD_OBJ_TYPE), (GD_OBJ_TYPE*)); */
-
-  if(GENERIC_GCREQUEST == res){
+  if(res == GENERIC_GCREQUEST){
       add_this_more_space(G_SIZE_IN_Q(GD_OBJ_TYPE));
-      
       inbuf->rd_index--;
-
-      /* fprintf(stderr, "Node %d Heap shortage in decoding vector(1)", my_node); */
       return;
   }
   newvect->method_table = &GD_method_table;
   newvect-> index = size = (long)GET_BUFFER(inbuf);
 
-  /* GD_ALLOC_AREA_FOR_NEW(body, (q*), size); */
   G_HEAPALLOC_WITH_CHECK(body, size, (q*), res); 
-  /* G_HEAPALLOC(body, size, (q*)); */
-  if(GD_GCREQUEST == res){
+  if(res == GENERIC_GCREQUEST){
       add_this_more_space(size);
-      
       inbuf->rd_index -= 2;
-
-      /* fprintf(stderr, "Node %d Heap shortage in decoding vector(2)", my_node); */
       return;
   }
 
diff -ruN klic-3.003-2002-03-19/runtime/gstring.c klic-3.003-2002-03-19a/runtime/gstring.c
--- klic-3.003-2002-03-19/runtime/gstring.c	Tue Mar 19 14:08:55 2002
+++ klic-3.003-2002-03-19a/runtime/gstring.c	Tue Mar 19 18:27:31 2002
@@ -167,7 +167,7 @@
   for(i = 0 ; i < size ; i++){
     PUT_BUFFER(buffer, tmp_buf[i]);  /* Should be carefule of endian */
   }
-  return(GENERIC_SUCCEEDED);
+  return GENERIC_SUCCEEDED;
 }
 #endif /* DIST */
 
@@ -179,7 +179,6 @@
   Shallow(GD_SELF);
   GD_UNIFY_VALUE(GD_ARGV[0],G_MAKEINT(GD_SELF->index));
   GD_UNIFY_VALUE(GD_ARGV[1],G_MAKEINT(ELEMSIZE));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(element_2)
@@ -190,7 +189,6 @@
   GDSET_INTARG_WITHIN_RANGE(position,GD_ARGV[0],0,(long)(GD_SELF->index));
   GD_UNIFY_VALUE(GD_ARGV[1],
 		 G_MAKEINT((unsigned long)(GD_SELF->body[position])));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(size_1)
@@ -198,7 +196,6 @@
   G_STD_DECL;
   Shallow(GD_SELF);
   GD_UNIFY_VALUE(GD_ARGV[0],G_MAKEINT(GD_SELF->index));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(element__size_1)
@@ -206,7 +203,6 @@
   G_STD_DECL;
   Shallow(GD_SELF);
   GD_UNIFY_VALUE(GD_ARGV[0],G_MAKEINT(ELEMSIZE));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(set__element_3)
@@ -245,7 +241,6 @@
   newstr->index = size;
   newstr->iscnst = 0;
   GD_UNIFY_VALUE(GD_ARGV[2], GD_OBJ(newstr));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(split_3)
@@ -276,7 +271,6 @@
   lower->body = lower_body;
   GD_UNIFY_VALUE(GD_ARGV[1],G_MAKEFUNCTOR(upper));
   GD_UNIFY_VALUE(GD_ARGV[2],G_MAKEFUNCTOR(lower));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(join_2)
@@ -312,7 +306,6 @@
   new->ismbdiff = 0;
   new->body = newbody;
   GD_UNIFY_VALUE(GD_ARGV[1],G_MAKEFUNCTOR(new));
-  GD_RETURN;
 }
 
 GDDEF_METHOD(search__character_4)
@@ -335,11 +328,10 @@
     }
   }
   GD_UNIFY_VALUE(GD_ARGV[3],G_MAKEINT(-1L));
-  GD_RETURN;
+  return;
 
   done:
     GD_UNIFY_VALUE(GD_ARGV[3],G_MAKEINT(k));
-  GD_RETURN;
 }
 
 
@@ -629,14 +621,9 @@
 
   G_HEAPALLOC_WITH_CHECK(newstring, G_SIZE_IN_Q(GD_OBJ_TYPE), 
 			  (GD_OBJ_TYPE*), res);
-  /* G_HEAPALLOC(newstring, G_SIZE_IN_Q(GD_OBJ_TYPE), (GD_OBJ_TYPE*)); */
-
-  if(GENERIC_GCREQUEST == res){ 
+  if(res == GENERIC_GCREQUEST){ 
       add_this_more_space(G_SIZE_IN_Q(GD_OBJ_TYPE));
-      
       inbuf->rd_index--;
-
-      /* fprintf(stderr, "Node %d Heap shortage in decoding string(1)", my_node); */
       return;
   }
   newstring->method_table = &GD_method_table;
@@ -649,14 +636,10 @@
     G_HEAPALLOC_WITH_CHECK(tmpbody, size, (q*), res); 
     body = (unsigned char *) tmpbody;
   }
-  /* G_HEAPALLOC(body, size, (unsigned char*)); */
 
-  if(GD_GCREQUEST == res){ 
+  if(res == GENERIC_GCREQUEST){ 
       add_this_more_space(size);
-      
       inbuf->rd_index -= 2;
-
-      /* fprintf(stderr, "Node %d Heap shortage in decoding string(2)", my_node); */
       return;
   }
 
@@ -669,7 +652,6 @@
   newstring->iscnst  = 0;
   newstring->body  = body;
 
-  /* decode_data = (q) makefunctor(newstring); */
   push_decode_stack((q)makefunctor(newstring));
 }
 #endif /* DIST */
diff -ruN klic-3.003-2002-03-19/runtime/otbl.c klic-3.003-2002-03-19a/runtime/otbl.c
--- klic-3.003-2002-03-19/runtime/otbl.c	Mon Feb 18 17:09:09 2002
+++ klic-3.003-2002-03-19a/runtime/otbl.c	Tue Mar 19 18:21:24 2002
@@ -21,7 +21,7 @@
 #define generic_deallocate(obj)  (obj)->method_table->deallocate(obj)
 
 struct object_table {
-  unsigned int type;
+  enum g_type type;
   void* obj;
   struct object_table* next;
 };
@@ -103,7 +103,7 @@
 extern void
 register_for_deallocation(obj, type)
   void* obj;
-  int type;
+  enum g_type type;
 {
   static int gc_hook_initialized = 0;
 
diff -ruN klic-3.003-2002-03-19/runtime/trace.c klic-3.003-2002-03-19a/runtime/trace.c
--- klic-3.003-2002-03-19/runtime/trace.c	Tue Mar 19 14:07:13 2002
+++ klic-3.003-2002-03-19a/runtime/trace.c	Tue Mar 19 18:21:24 2002
@@ -467,6 +467,14 @@
   print_debug_status(), print_port_names(),
   print_modules(), print_predicates();
 
+#ifdef PARALLEL
+#define PRINT_PORT(port,info,seq) \
+  trace_printf(info, "%d:%9d %s: ", my_node, seq, port);
+#else
+#define PRINT_PORT(port,info,seq) \
+  trace_printf(info, "%4d %s: ", seq, port);
+#endif
+
 static module trace_trigger_routine(glbl, qp, allocp, toppred)
   struct global_variables *glbl;
   struct goalrec *qp;
@@ -525,11 +533,7 @@
     if (Enabled(info,Call)) {
       TRACE_ATTACHIO();
       for (;;) {
-#ifdef PARALLEL
-	trace_printf(info, "%d:%9d CALL: ", my_node, parent_seq);
-#else
-	trace_printf(info, "%4d CALL: ", parent_seq);
-#endif
+	PRINT_PORT("CALL", info, parent_seq);
 	print_goal(qp, 0, info);
 	if (Leashed(info,Call) || Spying(info)) {
 	  if (!call_port_command(qp, get_mte(qp->pred), &info)) break;
@@ -609,11 +613,7 @@
       (!Leaping(info) || Spying(info))) {
     TRACE_ATTACHIO();
     for (;;) {
-#ifdef PARALLEL
-      trace_printf(info, "%d:%9d REDU: ", my_node, parent_seq);
-#else
-      trace_printf(info, "%4d REDU: ", parent_seq);
-#endif
+      PRINT_PORT("REDU", info, parent_seq);
       print_goal(parent, 0, info);
       if (subgoals != 0) {
         trace_printf(info, " :-");
@@ -706,11 +706,7 @@
   if (Enabled(info,Susp) && (!Leaping(info) || Spying(info))) {
     TRACE_ATTACHIO();
     for (;;) {
-#ifdef PARALLEL
-      trace_printf(info, "%d:%9d SUSP: ", my_node, seq);
-#else
-      trace_printf(info, "%4d SUSP: ", seq);
-#endif
+      PRINT_PORT("SUSP", info, seq);
       print_goal(qp, 0, info);
       if (Leashed(info,Susp) || Spying(info)) {
 	if (!susp_port_command(qp, get_mte(qp->pred), &info)) break;
@@ -763,11 +759,7 @@
   if (Enabled(info,Fail)) {
     TRACE_ATTACHIO();
     for (;;) {
-#ifdef PARALLEL
-      trace_printf(info, "%d:%9d FAIL: ", my_node, seq);
-#else
-      trace_printf(info, "%4d FAIL: ", seq);
-#endif
+      PRINT_PORT("FAIL", info, seq);
       print_goal(qp, 0, info);
       if (Leashed(info,Fail) || Spying(info)) {
 	if (!fail_port_command(qp, get_mte(qp->pred), &info)) break;
@@ -803,13 +795,8 @@
   trace_printf(info, "!!! Perpetual Suspention Detected !!!\n");
   if (Enabled(info,Fail)) {
     for (;;) {
-#ifdef PARALLEL
-      trace_printf(info, "%d:%9d PSUS: ", my_node, seq);
+      PRINT_PORT("PSUS", info, seq);
       print_goal(qp, 0, info);
-#else
-      trace_printf(info, "%4d PSUS: ", seq);
-      print_goal(qp, 0, info);
-#endif
       if (!fail_port_command(qp, get_mte(qp->pred), &info)) break;
     }
   }
diff -ruN klic-3.003-2002-03-19/runtime/unify.c klic-3.003-2002-03-19a/runtime/unify.c
--- klic-3.003-2002-03-19/runtime/unify.c	Tue Mar 12 12:34:38 2002
+++ klic-3.003-2002-03-19a/runtime/unify.c	Tue Mar 19 18:21:24 2002
@@ -29,9 +29,7 @@
  * other: the next hooked term
  ************/
 static q rest_of_stream;
-static q method_result;
 extern void set_rest_of_stream(q term){ rest_of_stream = term; }
-extern void set_method_result(q term){ method_result = term; }
 
 static void enqueue_unify_terms(q x, q y)
 {
@@ -135,54 +133,27 @@
       if (u.l != 0) {
 	if (is_consumer_hook(u)) {
 	  struct consumer_object *obj = untag_consumer_hook(u.o);
-	  q tmpval;
 	  long keepp = loopp->u.l;
 	  loopp->u.l = 0;
 	  set_heapp(allocp);
 	  generic_active_unify(obj, y);
 	  allocp = heapp();
-	  switch ((long)method_result) {
-	  case (long)GENERIC_FAILED:
-	    fatal("Unification failure on a consumer object");
-	  case (long)GENERIC_SUCCEEDED:
-	    if(rest_of_stream == NULL) goto consumer_terminate;
-/*	    y = rest_of_stream;*/
-	    tmpval = rest_of_stream;
-	    break;
-	  case (long)GENERIC_GCREQUEST:
-	    /* This case, make the hook chain which contains
-	       rest of consumer objects and goals. */
-	    {
-	      q newvar = makeref(allocp);
-	      allocp++;
-	      susprecord->u.first_hook.next = loopp;
-	      loopp->u.l = keepp;
-	      susprecord->backpt = newvar;
-	      derefone(newvar) = (q)susprecord;
-	      set_heapp(allocp);
-	      enqueue_unify_goal(y, newvar);
-	    }
-	    /* exit the loop */
-	    return;
-	  default:
-	    tmpval = method_result;
-	  }
-	  {
-	    struct susprec *susp;
+
+	  if(rest_of_stream != NULL){
+	    struct susprec* susp;
 	    q newvar;
-	    set_heapp(allocp);
+	    q tmpval = rest_of_stream;
+
 	    makenewsusp(newvar, susp);
 	    allocp = heapp();
 	    susp->u.first_hook.u.o = tag_consumer_hook(obj);
 	    if (derefone(tmpval) == tmpval) {
 	      derefone(tmpval) = newvar;
 	    } else {
-	      set_heapp(allocp);
 	      enqueue_unify_goal(tmpval, newvar);
 	      allocp = heapp();
 	    }
 	  }
-	consumer_terminate:;
 	} else if (isint(u.g->next)) {
 	  long gp = intval(u.g->next);
 	  if (stepping_flag) {
