Fixed a bug in computeG. Check diff.