Improve robustness of dependencies.sh