fix cfn_apply that returns a pointer as result type, set the pointer type and target type before calling the ffi.