Minor improvements on linear search.