Some slight modifications for spipm