Array bounds check in peak list handling