Make mkQualPackage more robust when package key is bad.