fix bugs with Set/List/Map serialization