Fix bug in G