Fix build errors and add .gitignore

I updated the project, fixed the build errors and added a .gitignore.