Moved finalizers functions from runtime.c