Fix bugs in parsing repo URL