Merge pull request #1601 from rubenk/thermal-make-some-variables-static