Fixed #15624 -- Added aggregate to aggregate_select_mask if mask is set