Backport changes from master to 2.12 branch
This MR backports the changes done to the master branch to the 2.12 branch.
The MR was generated by the following command:
git cherry-pick \
ba9b124534d4fcb22aaa3a0a5846b4a965c20ddc \
b33963775456662eae05e12438bddc5e896ec9ab
Backport of MR !7 (merged): ba9b1245 b3396377