Fix adding the same package entry multiple times to listings
Fix downloaded packages being added to local listing with wrong flavor