Fixed the somewhat broken keyword distance