More C API cleanup tweaks