Hopefully temporary workaround for C# generics bug