Fixed cloning a github repo into a directory without trailing slash. Closes #2063