carefully handle ignored files in gitignore
fix some mistakes in templates