added some checks and made install_tools and install_deps work right