C# Generator fixes