Fix ffi buffer

add buffer_spec for FFI and fix FFI::Buffer so the tests pass.