diff --git a/src/mapping.c b/src/mapping.c
index 9303695963c56d4de6487908002be4adc4892fce..8436ab7af96ae7ed619bdb3a727b5502fbe6c3b5 100644
--- a/src/mapping.c
+++ b/src/mapping.c
@@ -572,7 +572,7 @@ struct mapping *copy_mapping(struct mapping *m)
 
   LOOP(m) mapping_insert(n, &k->ind, &k->val);
   
-  return m;
+  return n;
 }
 
 struct mapping *merge_mappings(struct mapping *a, struct mapping *b, INT32 op)
@@ -704,9 +704,10 @@ void describe_mapping(struct mapping *m,struct processing *p,int indent)
 
   LOOP(m)
   {
-    if(!d)
+    if(d)
     {
       my_strcat(",\n");
+    } else {
       d=1;
     }
     for(d=0; d<indent; d++) my_putchar(' ');