Backporting changes from WCF 2.1