Raise error on out of bounds.