Bug fixes in simulation mode