basic interface, C segfault fix (but causing memory leaks?)