Fix extrema removing