Tighten up types for ffi functions