Added .tmp files to .gitignore and improved some things

@twostars If you could kindly take a look at this commit and check if I
did things right, that'd be appreciated!