Fix dependency resolving bug