Add two small optimizations. (#11196)