Added possibility to specify custom type name when serializing objects