Bugfix: detects wrong path when 'detect_git' is true