some compiling and testing fixes. Still segfaults