Not sure if this is related to #5702. (cherry picked from commit eebfad5a95e8ae88e1ee519c1919d996d924088c)