Fix warnings in C stubs