WCF compatibility

To be able to use the TypeSerializer in WCF these changes are required to support the most common cases.