         else if (rem == 3) vertex_index += item.z;
         else if (rem == 4) vertex_index += item.w;
       }
-      for (unsigned l = 1; l < level_count; l++) {
+      for (unsigned l = 1; l + 1 < level_count; l++) {
         uint32_t rem = vertex_offset % 5;
         vertex_offset = vertex_offset / 5;
         uint4 item = vertex_pyramid[level_offset[l] + vertex_offset];

        else if (rem == 2) vertex_index += item.y;
        else if (rem == 3) vertex_index += item.z;
        else if (rem == 4) vertex_index += item.w;
      }

      if (index_code & 0b001) {     // Vertex is on x-axis

    for (unsigned l = level_count - 4; 0 < l; l--) {
      offset = processHP5Item(key, 5 * offset, pyramid[level_offset[l] + offset]);
    }
    uchar4 b = ((const uchar4*)(pyramid + 4 + 32))[offset];
    offset = processHP5Item(key, 5 * offset, make_uint4(b.x, b.y, b.z, b.w));
    return { offset, key };
  }
