Localized values in some functions.

Just made some code localized, to prevent leakage and such.