Clean up and localize some variables.