fix bag scoping when bag does not have a name and when using _querySegmentForAttributeColumnWithValue