Correct the test for local maximum