Fix case where single id call to get_object_ids would break SQL query