(cherry picked from commit 699333ca06526d747a7eb4a188e896de81e9f014)
(cherry picked from commit cad5b4d7deba4fbe4a40a17306ce49d3b2f13139)
(cherry picked from commit c24e5d29733cfa771dd41ae40032029c6bbb9186)