minor fixes for c# port