Minor fixes for c# version