Updated the installation scripts to fix several bugs and improvements