Fix a bug where the local minimum could be updated to a value less than zero and cause additional pulses to be found