Fix peak selection in maximum mean gradient between peaks method.