Bugfixes in the simulation.