More robust install script