Fixes on SPI calculation (#62)