Added garbage collection support to C implementation of wrappers/proxy.