Fixed bug not stripping spaces from nearest neighbors.