diff --git a/src/interpret.c b/src/interpret.c
index 097d7d691c9d6427d6ee7d974a7ed0f1d1755dc1..3e41b2390806b48a682ff1587b782e3a9719036e 100644
--- a/src/interpret.c
+++ b/src/interpret.c
@@ -5,7 +5,7 @@
 \*/
 /**/
 #include "global.h"
-RCSID("$Id: interpret.c,v 1.123 1999/05/08 00:33:18 hubbe Exp $");
+RCSID("$Id: interpret.c,v 1.124 1999/05/08 16:42:48 grubba Exp $");
 #include "interpret.h"
 #include "object.h"
 #include "program.h"
@@ -652,12 +652,15 @@ void mega_apply2(enum apply_type type, INT32 args, void *arg1, void *arg2)
 #if defined(PIKE_DEBUG) && defined(_REENTRANT)
   if(d_flag)
     {
-      if( thread_id && !th_equal( OBJ2THREAD(thread_id)->id, th_self()) )
+      THREAD_T self = th_self();
+
+      if( thread_id && !th_equal( OBJ2THREAD(thread_id)->id, self) )
 	fatal("Current thread is wrong.\n");
 	
       if(thread_for_id(th_self()) != thread_id)
-	fatal("thread_for_id() (or thread_id) failed in mega_apply! %p != %p\n",thread_for_id(th_self()),thread_id);
-      }
+	fatal("thread_for_id() (or thread_id) failed in mega_apply! "
+	      "%p != %p\n", thread_for_id(self), thread_id);
+    }
 #endif
 
   switch(type)
diff --git a/src/threads.c b/src/threads.c
index 9252895d2d2b2d3b7d303f9442ed421d8724a3fa..cdf1bd38b20e9c73a7567cd564b3d932db3d6468 100644
--- a/src/threads.c
+++ b/src/threads.c
@@ -1,5 +1,5 @@
 #include "global.h"
-RCSID("$Id: threads.c,v 1.94 1999/05/08 00:41:01 hubbe Exp $");
+RCSID("$Id: threads.c,v 1.95 1999/05/08 16:49:24 grubba Exp $");
 
 int num_threads = 1;
 int threads_disabled = 0;
@@ -503,12 +503,16 @@ TH_RETURN_TYPE new_thread_func(void * data)
 #if defined(PIKE_DEBUG)
   if(d_flag)
     {
-      if( thread_id && !th_equal( OBJ2THREAD(thread_id)->id, th_self()) )
-	fatal("Current thread is wrong. %x %x\n",OBJ2THREAD(thread_id)->id,th_self());
+      THREAD_T self = th_self();
+
+      if( thread_id && !th_equal( OBJ2THREAD(thread_id)->id, self) )
+	fatal("Current thread is wrong. %x %x\n",
+	      OBJ2THREAD(thread_id)->id, self);
 	
       if(thread_for_id(th_self()) != thread_id)
-	fatal("thread_for_id() (or thread_id) failed in new_thread_func! %p != %p\n",thread_for_id(th_self()),thread_id);
-      }
+	fatal("thread_for_id() (or thread_id) failed in new_thread_func! "
+	      "%p != %p\n", thread_for_id(self), thread_id);
+    }
 #endif
 
 #ifdef THREAD_TRACE