Fix libffi handling