(cherry picked from commit e0eb712136aa8cd786955e9109afbbf8ba42555c)
(cherry picked from commit 8aa385069f830fc801c8a04d2bd8a70a02be3de4)
(cherry picked from commit 9d810ddcc1938a90090fd60f8924f4e83acbeee2)