(cherry picked from commit d38ad85a05cb3547ad1c3f90531811aa9c78ca9d)
(cherry picked from commit b94f9b8c1b)
(cherry picked from commit c1e96a11e9d552d5597b51dd6d786fcd3340b199)
(cherry picked from commit 88ffa46b20d6a031f5f349d8e9effec2c4307ff5)
(cherry picked from commit 6be3216694c08c3b3e84973146bc0fc097e40919)