Fix two `diagrams` tool issues with saving referenced modules information