Fixed some bugs in the original install script.