fixed error in serialize()

This one was preventing objects to serialize to strings and crashing the app when it tried to.
Merge pull request #38 from der-On/master

fixed error in datatypes.serialize()