Small tweaking on the kernel code of the local extrema detection