Use .Cast<>() to fix support in .NET 3.5