fix bug in FFI function laziness