Keep track and initialize to nil used gvars

fixes #489