Fixed tools setting in to_dict() and to_obj()