C compatibility fixes

No compile errors left for C API users
Closes #10