Fix two criticals bugs in the packager lib and repository command line