diff --git a/luatex/debug.lua b/luatex/debug.lua
index f6b789769a59bfdac50d25e024f7fdd49d1c1f1d..4df4477ea01d396af8a915f992d068d59ca08024 100644
--- a/luatex/debug.lua
+++ b/luatex/debug.lua
@@ -102,14 +102,14 @@ function show_page_elements(parent)
       parent.list = node.insert_before(parent.list,head,hyphen_marker)
 
 
-  elseif head.id == 10 then -- glue
-      local wd = head.spec.width
+  elseif head.id == 12 then -- glue
+      local wd = head.width
       local color = "0.5 G"
-      if parent.glue_sign == 1 and parent.glue_order == head.spec.stretch_order then
-        wd = wd + parent.glue_set * head.spec.stretch
+      if parent.glue_sign == 1 and parent.glue_order == head.stretch_order then
+        wd = wd + parent.glue_set * head.stretch
         color = "0 0 1 RG"
-      elseif parent.glue_sign == 2 and parent.glue_order == head.spec.shrink_order then
-        wd = wd - parent.glue_set * head.spec.shrink
+      elseif parent.glue_sign == 2 and parent.glue_order == head.shrink_order then
+        wd = wd - parent.glue_set * head.shrink
         color = "1 0 1 RG"
       end
       local pdfstring = node.new("whatsit","pdf_literal")
@@ -122,7 +122,7 @@ function show_page_elements(parent)
       parent.list = node.insert_before(parent.list,head,pdfstring)
 
 
-    elseif head.id == 11 then -- kern
+    elseif head.id == 13 then -- kern
       local rectangle = node.new("whatsit","pdf_literal")
       local color = "1 1 0 rg"
       if head.kern < 0 then color = "1 0 0 rg" end
@@ -134,7 +134,7 @@ function show_page_elements(parent)
       end
       parent.list = node.insert_before(parent.list,head,rectangle)
 
-    elseif head.id == 12 then -- penalty
+    elseif head.id == 14 then -- penalty
       local color = "1 g"
       local rectangle = node.new("whatsit","pdf_literal")
       if head.penalty < 10000 then
@@ -143,7 +143,7 @@ function show_page_elements(parent)
       rectangle.data = string.format("q %s 0 w 0 0 10 10 re B Q",color)
       parent.list = node.insert_before(parent.list,head,rectangle)
 
-    elseif head.id == 37 then -- glyph
+    elseif head.id == 29 then -- glyph
       local rule_width = 0.8
       local wd = math.round(head.width                  / number_sp_in_a_pdf_point - rule_width     ,2)
       local ht = math.round((head.height + head.depth)  / number_sp_in_a_pdf_point - rule_width     ,2)