Improve C# compatibility (closes #715)
Merge pull request #717 from ovatsus/master

Improve C# compatibility