diff --git a/build.json b/build.json
index 7d6afd48cb80404f25499dc4019e8eb24ccd1ee2..341c0fe3c3f7413048704651339ba764191ea2db 100644
--- a/build.json
+++ b/build.json
@@ -1,8 +1,7 @@
 {
-  "#": "This file describes the list of targets and dependencies.",
-  "#": "It is used among other things to generate all of our project files.",
-  "#": "Please refer to the templates directory for more information.",
-
+  "#1": "This file describes the list of targets and dependencies.",
+  "#2": "It is used among other things to generate all of our project files.",
+  "#3": "Please refer to the templates directory for more information.",
   "settings": {
     "#": "The public version number of the library.",
     "version": {
diff --git a/tools/buildgen/build-cleaner.py b/tools/buildgen/build-cleaner.py
index 6c5355bce39964547a6a0605037c87129a86eab4..fba103723cff0e425129b33cbb6222273eb81488 100755
--- a/tools/buildgen/build-cleaner.py
+++ b/tools/buildgen/build-cleaner.py
@@ -52,11 +52,15 @@ _ELEM_KEYS = [
 
 def rebuild_as_ordered_dict(indict, special_keys):
   outdict = collections.OrderedDict()
+  for key in sorted(indict.keys()):
+    if '#' in key:
+      outdict[key] = indict[key]
   for key in special_keys:
     if key in indict:
       outdict[key] = indict[key]
   for key in sorted(indict.keys()):
     if key in special_keys: continue
+    if '#' in key: continue
     outdict[key] = indict[key]
   return outdict