Fix euclidean distance function.
Add a test for euclidean distance function.