Better exception handling
FFI: fix the segfaults at startup