Added support for simulation and replace.