fixed template usage in new PatchingDataStructures helper code