Fix exit bug.