Fixed error on matrix size in KNNSearch