Further bug corrections to knnImp.