Merge pull request #745 from katyo/avoid-global-constant-vector

Avoid global variables