Checking euclideanDist for NaN is enough. This breaks the tests, though