Numerous fixes around package management. Kudos to @koobs.