Minor bug fix for installation scripts and add .gitignore file

Hi there,

I found this repo very useful but find some minor bugs, thus sending this pulling request to fix them.

Also avoiding the built files is a good practice, so a .gitignore file is added.

Regards,
Lihang