Fixed empty array passed to numpy.mean etc.