Fixing on $type property whenever has an empty value.
Serialization implementation for objects into string.