Fix exit behavior