MDL-42711 added scoping and more RTL fixes.