Further fixes to complete transition to proper C FFI.