Fix wrong variable name
Add missing factors of (2pi)^2 in off-diagonal terms
Allow restriction of xg range