Add support for passing native instances as pointers