Added special case to cope with zero-rank datasets in maths functions