fix some segfault sources in native