Some C# static analysis errors fixed (#58)