.gitignore includes IntelliJ files
Fixed potential NPEs