Fix libdb2 issues (#7860)