Fix crash when specifying an invalid repo with -r

Fixes:	#533