This seems wrong to me, it shouldn't throw away the outer dimension in the size=1 case, rather just produce size-one arrays.