Properly handle dependencies of dependencies.