Don't use a global object
Merge pull request #990 from errietta/bug1069400

Don't use a global object