Reimplemented `rootForType`
Merge pull request #1212 from bradleypriest/rootForType

Reimplemented `rootForType`