Lots of dependency graph fixes