Tweaks to C# implementataion