Bug fixes and additions to the C API.