Backport changes from ds-four