Update .gitignore and fix tmp directory