Fixing the peaks array bounds