Various fixes.

Do not free the supplied repo as we are not the owner of it.
Return proper return code on success.
Fail, if a unsupport option is supplied (all currently).