Backport #6821 and #6762 to release-v2.8
#6823
+9
−2
Merged
release-v2.8
#6823