Updated to work with .NET 4.5.