bugfix in list_type and get_common_ancestor