Fix removal of packages without any valid metadata.