Optimization for some common insertion cases.