Updated ffi.rs and fixed-up changes needed because of Rust lang changes.