Converted tree modify functions in wrappers that ref/unref.