Yesterday's 2nd modification to the fix_related_bias_pins.py script
to fix an error that had been shadowed by the first problem being
fixed accidentally caused the first problem to no longer get fixed.
The correction being pushed now has been checked and confirm to
fix both problems at the same time.
diff --git a/VERSION b/VERSION
index af7d950..1e12fc6 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.0.336
+1.0.337
diff --git a/sky130/custom/scripts/fix_related_bias_pins.py b/sky130/custom/scripts/fix_related_bias_pins.py
index 222b944..bf2d698 100755
--- a/sky130/custom/scripts/fix_related_bias_pins.py
+++ b/sky130/custom/scripts/fix_related_bias_pins.py
@@ -32,6 +32,10 @@
     modified = False
     current_pin = ''
 
+    # Values for "pg_type" other than "pwell" or "nwell"
+    power_types = ['primary_power', 'primary_ground', 'backup_power',
+		   'internal_power', 'internal_ground']
+
     related_re = re.compile('\s*related_bias_pin\s*:\s*"(.+)"\s*;')
     pg_re = re.compile('\s*pg_pin\s*\(\s*"(.+)"\s*\)\s*{')
     well_re = re.compile('\s*pg_type\s*:\s*"(.+)"\s*;')
@@ -47,12 +51,13 @@
             if pin_str == 'VPB' and current_pin == 'VGND':
                 modified = True
                 line = line.replace(pin_str, 'VNB')
+                current_pin = ''
             elif pin_str == 'VNB' and current_pin == 'VPWR':
                 modified = True
                 line = line.replace(pin_str, 'VPB')
+                current_pin = ''
             else:
                 print('Warning: Unknown related bias pin ' + pin_str)
-            current_pin = ''
 
         wmatch = well_re.match(line)
         if wmatch:
@@ -60,12 +65,13 @@
             if well_str == 'nwell' and current_pin == 'VNB':
                 modified = True
                 line = line.replace(well_str, 'pwell')
+                current_pin = ''
             elif well_str == 'pwell' and current_pin == 'VPB':
                 modified = True
                 line = line.replace(well_str, 'nwell')
-            else:
+                current_pin = ''
+            elif well_str not in power_types:
                 print('Warning: Unknown well type ' + well_str)
-            current_pin = ''
 
         fixedlines.append(line)