fixed issue where object properties where ignored by serialize

with the latest merges from pull requests simple object properties where skipped by the serialize function if they weren't types of ObjectId or Date.