Fix KeyError exception targets.dependencies