Added compatibility with older .NET versions (used by Unity3D)