Work around for C# generics bug