Thanks Carlton Gibson for the review. Backport of 5df3301aab9e1d1c386799263bef5cf013985c83 from master