Fix get_instances_ids function when there are instances with no tags