Ensuring Query/EC2 collections are correctly flattened or have their respective element set