The check should say `isPackageClass`. The fact that `isPackage` returns true for package classes is weird.