Improve the checks to see if a dependency is from a peer subproject