Backport some changes from experimental