(cherry picked from commit bf74937162fccc09675002373f51440d49efda04)
(cherry picked from commit b5b7eb6b95b5e2c741ba5c7ce0192d966e1d1fec)
(cherry picked from commit 746f67b100d1fa16faeae07acceef4e7ff0ce24b)