Add .gitignores and fix compile warnings