Fixes/improvements to the APT package_* functions