miniSim: exit bug fixed.