Fixed some bugs in the install script.