Fixed a race condition that affected co-simulation.