improvements of SPSP and unit tests