Changed a few APIs to masquerade low-level FFI details.