incorporate Mono.Reflection code to C# project and bug fix