Fix simulator bug