Lots of changes to better match .NET