Made detection of the git branch more reliable