ref-filter: make ref_array_item allocation more consistent