Backport of dev changes.