diff --git a/lib/modules/Tools.pmod/PEM.pmod b/lib/modules/Tools.pmod/PEM.pmod
index e1987e6e40bd81da384bc9d3078facf234e01642..d0f60ada3401cad1e9e82a349f181d01e7a01dd2 100644
--- a/lib/modules/Tools.pmod/PEM.pmod
+++ b/lib/modules/Tools.pmod/PEM.pmod
@@ -111,8 +111,10 @@ class rfc934 {
 	  initial_text = current;
 	else
 	{
+#ifdef PEM_DEBUG
 	  werror(sprintf("boundary='%s'\ncurrent='%s'\n",
 			 boundary, current));
+#endif
 	  encapsulated
 	    += ({ encapsulated_message()->init(boundary, current) });
 	}
@@ -169,7 +171,7 @@ class pem_msg
       object msg = rfc934()->init(s);
       parts = ([ ]);
 
-      parts->initial_text = msg->initial_text;
+      initial_text = msg->initial_text;
 
       for(int i = 0; i<sizeof(msg->encapsulated); i += 2 )
       {
@@ -196,7 +198,7 @@ class pem_msg
 	{
 	  /* This was the last section. Use the final_boundary. */
 	  res = end_pem_re->split(msg->get_final_boundary());
-	  parts->final_text = msg->final_text;
+	  final_text = msg->final_text;
 	}
 
 	if (!res || (res[0] != name))