Updated permissions
Fixed a minor error in the branch function. The parameter was not in quotes and this was creating a problem when changing dir to a dir with space in its name.