Merge "Handle the case cwd has a trailing slash."