Further refinements to deal with empty data sets passed to lower level functions