Handle nulls in arrays