Worried about the performance implications of these lines - if this does any iteration/walking of objects this may be very costly in the deserializer.  I can see why it is needed though and performance will always be a tradeoff.  Will get a chance to test more thoroughly later.