Use cleanup instead of exit.