Fix a simulation shutdown issue.