Backport fixes to Dev.