fix "right extrema bug" for morphological filters