diff --git a/lib/modules/Sql.pmod/pgsql.pike b/lib/modules/Sql.pmod/pgsql.pike
index f8b5fed02a90b4de04e590ee412a218f954a78d5..5c0d79e341ef9458e83acb0cae09ba292d6e72a6 100644
--- a/lib/modules/Sql.pmod/pgsql.pike
+++ b/lib/modules/Sql.pmod/pgsql.pike
@@ -87,7 +87,7 @@ private Thread.Mutex resyncmux;
 protected string _sprintf(int type) {
   string res;
   if (!this)					// Not in destructed objects
-    return UNDEFINED;
+    return "(destructed)";
   switch(type) {
     case 'O':
       res = sprintf(DRIVERNAME"(%s@%s:%d/%s,%d,%d)",
diff --git a/lib/modules/Sql.pmod/pgsql_util.pmod b/lib/modules/Sql.pmod/pgsql_util.pmod
index 256f27ddd7fc727122e7d411ffa8df592f266df9..8d94038f76b609d973023561d826c3906e161491 100644
--- a/lib/modules/Sql.pmod/pgsql_util.pmod
+++ b/lib/modules/Sql.pmod/pgsql_util.pmod
@@ -718,14 +718,14 @@ outer:
   private string _sprintf(int type) {
     string res;
     if (!this)					// Not in destructed objects
-      return UNDEFINED;
+      return "(destructed)";
     switch (type) {
       case 'O':
         int fd = -1;
         if (socket)
           catch(fd = socket->query_fd());
         if (!this)				// Not in destructed objects
-          return UNDEFINED;
+          return "(destructed)";
         res = predef::sprintf("conxion  fd: %d input queue: %d/%d "
                     "queued portals: %d  output queue: %d/%d\n"
                     "started: %d\n",
@@ -827,7 +827,7 @@ class sql_result {
   protected string _sprintf(int type) {
     string res;
     if (!this)					// Not in destructed objects
-      return UNDEFINED;
+      return "(destructed)";
     switch (type) {
       case 'O':
         int fd = -1;
@@ -1827,7 +1827,7 @@ class proxy {
   private string _sprintf(int type) {
     string res;
     if (!this)					// Not in destructed objects
-      return UNDEFINED;
+      return "(destructed)";
     switch (type) {
       case 'O':
         res = sprintf(DRIVERNAME".proxy(%s@%s:%d/%s,%d,%d)",
diff --git a/lib/modules/Thread.pmod b/lib/modules/Thread.pmod
index d13cf163df50fcce188325672ec08b8d4cc30c6d..aaa6d278f325b18be79fa1f235e43e487621f46e 100644
--- a/lib/modules/Thread.pmod
+++ b/lib/modules/Thread.pmod
@@ -240,7 +240,7 @@ optional class Fifo {
   protected string _sprintf( int f )
   {
     if (!this)				// Only if not destructed
-      return UNDEFINED;
+      return "(destructed)";
     return f=='O' && sprintf( "%O(%d / %d)", this_program,
 			      size(), read_tres );
   }
@@ -410,7 +410,7 @@ optional class Queue {
   protected string _sprintf( int f )
   {
     if (!this)				// Only if not destructed
-      return UNDEFINED;
+      return "(destructed)";
     return f=='O' && sprintf( "%O(%d)", this_program, size() );
   }
 }
@@ -511,7 +511,7 @@ optional class Farm
     protected string _sprintf( int f )
     {
       if (!this)				// Only if not destructed
-        return UNDEFINED;
+        return "(destructed)";
       switch( f )
       {
 	case 't':
@@ -627,7 +627,7 @@ optional class Farm
     protected string _sprintf( int f )
     {
       if (!this)				// Only if not destructed
-        return UNDEFINED;
+        return "(destructed)";
       switch( f )
       {
 	case 't':
@@ -873,7 +873,7 @@ optional class Farm
   protected string _sprintf( int f )
   {
     if (!this)				// Only if not destructed
-      return UNDEFINED;
+      return "(destructed)";
     return f=='O' && sprintf( "%O(/* %s */)", this_program, debug_status() );
   }
 
@@ -950,7 +950,7 @@ optional class ResourceCount {
   /*semi*/private string _sprintf(int type) {
     string res = UNDEFINED;
     if (!this)				// Only if not destructed
-      return UNDEFINED;
+      return "(destructed)";
     switch(type) {
       case 'O':
         res = sprintf("Count: %d", _count);
@@ -1152,7 +1152,7 @@ optional class Fifo
   protected string _sprintf( int f )
   {
     if (!this)				// Only if not destructed
-      return UNDEFINED;
+      return "(destructed)";
     return f=='O' && sprintf( "%O(%d / %d)", this_program,
 			      size(), read_tres );
   }
@@ -1232,7 +1232,7 @@ optional class Queue
   protected string _sprintf( int f )
   {
     if (!this)				// Only if not destructed
-      return UNDEFINED;
+      return "(destructed)";
     return f=='O' && sprintf( "%O(%d)", this_program, size() );
   }
 }
@@ -1280,7 +1280,7 @@ class ResourceCount {
   {
     string res = UNDEFINED;
     if (!this)				// Only if not destructed
-      return UNDEFINED;
+      return "(destructed)";
     switch(type) {
       case 'O':
         res = sprintf("Count: %d", _count);