             Serial.println(macroMetadataIndexInner);
             inner_loop_metadata[macroMetadataIndexInner][2] = 0; // Reset current input index for inner loop
             inner_loop_metadata[macroMetadataIndexInner][4] = 0; // Reset current repeat counter for inner loop
+            Serial.print("AFTER macroMetadataIndexInner = ");
+            Serial.println(macroMetadataIndexInner);
+          }
+        }
+        if (inner_loop_metadata[0][1] <= 0 || inner_loop_metadata[0][3] <= 0) {
+          // Clear all inner loop metadata if first inner loop metadata is invalid
+          macroMetadataIndex = 0;
+          howManyInnerLoopsMacroHas = 0;
+          Serial.println("TEST GHI");
+          for (uint8_t macroMetadataIndexInner = 0; macroMetadataIndexInner < macroMetadataSize; macroMetadataIndexInner++) {
+            Serial.print("BEFORE macroMetadataIndexInner = ");
+            Serial.println(macroMetadataIndexInner);
+            inner_loop_metadata[macroMetadataIndexInner][0] = 0;
+            inner_loop_metadata[macroMetadataIndexInner][1] = 0;
+            inner_loop_metadata[macroMetadataIndexInner][2] = 0;
+            inner_loop_metadata[macroMetadataIndexInner][3] = 0;
+            inner_loop_metadata[macroMetadataIndexInner][4] = 0;
+            inner_loop_metadata[macroMetadataIndexInner][5] = 0;
+            inner_loop_metadata[macroMetadataIndexInner][6] = 0;
+            inner_loop_metadata[macroMetadataIndexInner][7] = 0;
+            inner_loop_metadata[macroMetadataIndexInner][8] = 0;
+            inner_loop_metadata[macroMetadataIndexInner][9] = 0;
+            inner_loop_metadata[macroMetadataIndexInner][10] = 0;
+            inner_loop_metadata[macroMetadataIndexInner][11] = 0;
             Serial.print("AFTER macroMetadataIndexInner = ");
             Serial.println(macroMetadataIndexInner);
           }

      timesToLoop = 0;
      loopCounter = 0;
      howManyInnerLoopsMacroHas = 0;
      isInputting = true;
      isInputtingDelayed = false;
      previousInputDelay = millis();

          if (howManyInnerLoopsMacroHas > 0) {
            Serial.println("TEST ABC");
            macroMetadataIndex = 0;
            // Check if the first inner loop metadata is valid, if it is, use that, if not, disregard and don't do anything
            if (inner_loop_metadata[0][1] > 0 && inner_loop_metadata[0][3] > 0) {
              // Accept inner loop metadata if first inner loop metadata is valid
              Serial.println("TEST DEF");
              macroMetadataIndex = 0;
              for (uint8_t macroMetadataIndexInner = 0; macroMetadataIndexInner < howManyInnerLoopsMacroHas; macroMetadataIndexInner++) {
