backport db branch fixes