Fixed a small bug in which the right peak segment got no reset