Simulation bugfixes