Fixed bugs in PISWAP, hopefully fixed segfault in spectralToDistance