fixed unit test failures. pkgagent is unsafe when unpload_pk is null.