Fix maxima searching.