Fixed HANDLE prototype in underlying FFI code and added some typedefs.