fix a bug in spectral kernel