pkg2: fixes to make working with unregistered packages work better.