diff -ruN klic-3.003-2002-02-17a/compiler/write.kl1 klic-3.003-2002-02-17b/compiler/write.kl1
--- klic-3.003-2002-02-17a/compiler/write.kl1	Sun Feb 17 13:55:20 2002
+++ klic-3.003-2002-02-17b/compiler/write.kl1	Sun Feb 17 14:46:25 2002
@@ -363,7 +363,7 @@
   klic_comp_obj:klicformat(
     " interrupt_0:\n"
     "  set_heapp(allocp);\n"
-    "  interrupt_goal0(toppred, reasonp);\n"
+    "  interrupt_goal(toppred, reasonp);\n"
     "  allocp = heapp();\n" )-Out.
 write_interrupt_call( N, Max )-Out :- N>0 |
   N1 := N-1,
diff -ruN klic-3.003-2002-02-17a/include/klic/control.h klic-3.003-2002-02-17b/include/klic/control.h
--- klic-3.003-2002-02-17a/include/klic/control.h	Sun Feb 17 13:56:30 2002
+++ klic-3.003-2002-02-17b/include/klic/control.h	Sun Feb 17 14:47:48 2002
@@ -11,9 +11,9 @@
 #include <klic/alloc.h>  /* klic_interrupt */
 
 /* runtime/faisus.c */
-extern q* interrupt_goal(q* allocp, const struct predicate* pred, q* reasonp);
+extern void interrupt_goal(const struct predicate* pred, q* reasonp);
 extern void interrupt_goal0(const struct predicate* pred, q* reasonp);
-extern int check_stack_for_alternatively(q* allocp, q* reasonp);
+extern int check_stack_for_alternatively(q* reasonp);
 
 
 /* runtime/sched.c */
@@ -24,10 +24,10 @@
 
 extern struct goalrec* enqueue_after_waiting(
   struct goalrec* qp, q prio,
-  struct goalrec* gp, q* allocp, int is_relative );
+  struct goalrec* gp, int is_relative );
 
 extern struct goalrec* enqueue_throw_goal(
-  q penum, struct goalrec* gp, struct goalrec* qp, q* allocp );
+  q penum, struct goalrec* gp, struct goalrec* qp );
 
 
 /** enqueue_at_priority: procedure
@@ -37,8 +37,9 @@
  */
 
 #define _ENQUEUE_AT_PRIORITY(p, q0, q, is_rel) \
-  (qp = enqueue_after_waiting((struct goalrec*) (q0), \
-    (p), (struct goalrec*) (q), allocp, (is_rel)))
+  (set_heapp(allocp), \
+    (qp = enqueue_after_waiting((struct goalrec*) (q0), \
+      (p), (struct goalrec*) (q), (is_rel)) ))
 
 #define _ENQUEUE_AT_PRIORITY_NO_CHECK(prio, q0, q) \
   (qp = enqueue_goal((struct goalrec*) (q0), \
@@ -78,7 +79,7 @@
     reduction_count = 0; \
     heaplimit = 0; \
   } \
-while(0)
+}while(0)
 #else /* !defined(DIST) || !defined(USE_REDUCTION_COUNT) */
 #define _INC_REDUCTION_COUNT(maxcount)
 #endif
@@ -125,8 +126,9 @@
  */
 #define throw_goal(node, oldqp, goal) \
 do{ \
+  set_heapp(allocp); \
   qp = enqueue_throw_goal((node), (struct goalrec*) (goal), \
-    (struct goalrec*) (oldqp), allocp); \
+    (struct goalrec*) (oldqp)); \
 }while(0)
 
 #endif /* _KLIC_CONTROL_H_ */
diff -ruN klic-3.003-2002-02-17a/include/klic/gb.h klic-3.003-2002-02-17b/include/klic/gb.h
--- klic-3.003-2002-02-17a/include/klic/gb.h	Sat Feb 16 11:44:41 2002
+++ klic-3.003-2002-02-17b/include/klic/gb.h	Sun Feb 17 14:34:36 2002
@@ -251,7 +251,9 @@
 #define alternative(lab) \
 do{ \
   if (reasonp != reasons) { \
-    int macrotmp = check_stack_for_alternatively(allocp, reasonp); \
+    int macrotmp; \
+    set_heapp(allocp); \
+    macrotmp = check_stack_for_alternatively(reasonp); \
     allocp = heapp(); \
     if (macrotmp != 0) goto lab; \
   } \
diff -ruN klic-3.003-2002-02-17a/runtime/faisus.c klic-3.003-2002-02-17b/runtime/faisus.c
--- klic-3.003-2002-02-17a/runtime/faisus.c	Sun Feb 17 14:00:55 2002
+++ klic-3.003-2002-02-17b/runtime/faisus.c	Sun Feb 17 14:43:20 2002
@@ -166,15 +166,12 @@
 }
 
 
-extern q*
-interrupt_goal(allocp, pred, reasonp)
-  q* allocp;
+extern void
+interrupt_goal(pred, reasonp)
   const struct predicate* pred;
   q* reasonp;
 {
-  set_heapp(allocp);
   interrupt_goal0(pred, reasonp);
-  return heapp();
 }
 
 extern void
@@ -312,11 +309,11 @@
 
 
 extern int
-check_stack_for_alternatively(allocp, reasonp)
-  q* allocp;
+check_stack_for_alternatively(reasonp)
   q* reasonp;
 {
   declare_globals;
+  q* allocp = heapp();
 
   while (reasonp != reasons) {
     /* suspension stack is not empty */
diff -ruN klic-3.003-2002-02-17a/runtime/sched.c klic-3.003-2002-02-17b/runtime/sched.c
--- klic-3.003-2002-02-17a/runtime/sched.c	Sun Feb 17 13:19:20 2002
+++ klic-3.003-2002-02-17b/runtime/sched.c	Sun Feb 17 14:45:48 2002
@@ -225,15 +225,15 @@
 }
 
 extern struct goalrec*
-enqueue_after_waiting(qp, prio, gp, allocp, is_relative)
+enqueue_after_waiting(qp, prio, gp, is_relative)
   struct goalrec* qp;
   q prio;
   struct goalrec* gp;
-  q* allocp;
   int is_relative;
 {
   declare_globals;
   struct goalrec* ng;
+  q* allocp = heapp();
   int k;
  again:
   if( isint(prio) ){
@@ -287,21 +287,22 @@
   int is_relative = intval(qp->args[arity+2]);
 
   qp->pred = (struct predicate*) consp(qp->args[arity]);
-  qp = enqueue_after_waiting(qp->next, prio, qp, allocp, is_relative);
+  set_heapp(allocp);
+  qp = enqueue_after_waiting(qp->next, prio, qp, is_relative);
   set_heapp(allocp);
   current_queue = qp;
   return (module) qp->pred->func;
 }
 
 extern struct goalrec*
-enqueue_throw_goal(penum, gp, qp, allocp)
+enqueue_throw_goal(penum, gp, qp)
   q penum;
   struct goalrec* gp;
   struct goalrec* qp;
-  q* allocp;
 {
   declare_globals;
   struct goalrec* ng;
+  q* allocp = heapp();
   int k;
  again:
   if( isint(penum) ){
@@ -361,7 +362,8 @@
   q penum = qp->args[arity+1];
 
   qp->pred = (struct predicate*) consp(qp->args[arity]);
-  qp = enqueue_throw_goal(penum, qp, qp->next, allocp);
+  set_heapp(allocp);
+  qp = enqueue_throw_goal(penum, qp, qp->next);
   set_heapp(allocp);
   current_queue = qp;
   return (module) qp->pred->func;
