A few C-API refinements