Fixed SPI bug and added priorities to process management