Added some more code for dependency resolution.