Recursively check dependencies.