Cleanup and fix typo in packages.by_ids