Cherry-picked changes from the 'web' branch.