Additional changes to #12275 and #12292
Merge pull request #12297 from Quy/master

Additional changes to #12275 and #12292