Fix a bug when importing whole packages.