Fix bugs in improved install script