Fix tests which fail with Package.Metadata == null after rebase