Fix SPI function.