Modified createPathMap for primitive types