Add DetunedGaussians and some minor fixes