83ad6042a7 & b267cd6fb4 Does not include test code to avoid risking merge conflicts. (cherry picked from commit 415585a30d74fcae61f581808220a7aaeca3eaf5)
83ad6042a7
b267cd6fb4