Fixed bug in distance calculation in KNN alg.