Replace inappropriate lists and dicts with sets