Fixed the stringToStructureType function