Some fixes for the C interface.