Fix bugs in GHOG (C# version).