fix GC bug introduced with the C finalizer support