Replace the unsafe _id optimization.