Fixed simulator not exiting properly.