Fix issue #101 (leaking global variable)