Set all local variables before exiting.