Fix FFI issue in Device class without changing API