Added support for weak global references.