Edit statdist() to not crash if nans are provided.