FFI improvements