fixed a possible crash in adjustPeak().