Fixes a few bugs in repo.sh