Fix bug in the `diagrams` tool when testing if an entity is a protocol