diff --git a/helpers/inspect-library.c b/helpers/inspect-library.c
index 47ba7c024a5f3c6020a11df536d5257bb338f533..5467eee539825b8ad0135f5d4c528a2d508f85c8 100644
--- a/helpers/inspect-library.c
+++ b/helpers/inspect-library.c
@@ -327,7 +327,7 @@ main (int argc,
           print_json_string_content (entry);
           printf ("\"");
         }
-      printf ("\n    ],");
+      printf ("\n    ]");
 
       free (missing_symbols);
       free (misversioned_symbols);
@@ -339,7 +339,7 @@ main (int argc,
   while (dep_map != NULL && dep_map->l_prev != NULL)
     dep_map = dep_map->l_prev;
 
-  printf ("\n    \"dependencies\": [");
+  printf (",\n    \"dependencies\": [");
   first = true;
   for (; dep_map != NULL; dep_map = dep_map->l_next)
     {