More fixes to label_map and some debugging code that will need yanking later