longs in the ffi and better error messages