Remove trailing slashes on 4 instances

Mainly to cover the root so / becomes nothing so we don't end up with a
double slash. Worth removing anyway incase it's passed elsewhere
somehow/through the API.
Remove line return

Was causing issues with adding to root. Needs to be just like its set in
lib/get-branch.php