CSharp: Some fixes