Added checking for protocol type in allDefinitionsForType