A couple of fixes

Fix a warning found when compiling with -Wall and add generated files to .gitignore.