Corrected overly strict bounds check