Fixed bug in GC due to WeakPointer class not being initialized