Make sure Serialize() doesn't fail for objects which don't have a registered type

fixes #7895