checks for self in FFI wrappers