[RT #40545] [RT #40547] [RT #40561] [RT #40563] (cherry picked from commit f7ec0518c3270bd72887b23a209b83437e7a1473)