Simulation bug fixes.