Fix name disambiguation bug in pruneByType by normalising types