Correct detection of remote repository name to not delete CWD in case of failures (#99)