Query used to fetch mast number in series breaks due to sql MAX function handing string and number ordering differently. This causes the last "[name] - 9" series to be picked up as last in the series instead of "[name] - 10". Fix is to cast value to unsigned to MAX handles ordering correctly.