Bug fixes on g(r), plus linear g(r) added.