Better downloaded dependency detection.

Woow, sorry about breaking everything! This PR fixes the build again.

/cc @d2fn