Avoid slowing down git prompt

Because I use __git_ps1 in my prompt aliasing git with git-achievements lead to a considerable slowdown of my prompt. This patch fixes that. The other two commits are just minor cleanups.

I use this change since months without a hitch but didn't decide until now to share it.