Merge pull request #1786 from laroche/static_vars_functions

Change some vars and functions to be static.