Fixed all errors caused by the conversion to .NET 3.5