Fix of serializing and deserializing problems

Hello,

I have used your code, but ran into a few problems with serializing and deserializing of some objects. I have made ​​some corrections, and got it to work in my Windows Phone 8 project.

The changes is not tested in IOS and Android.