Fix bug in the `diagrams` tool where generating diagrams for both a library and its sub-libraries would miss the entities and files in the top library