Change pathForType with rootForType accordingly to #1230