Fix out-of-order insertion.