Better cleanup on exit