Fix a bug when getting all package instances