Fixed some C# issues