Throw BoundsError for invalid indices

Throw `BoundsError` for invalid indices. This makes behavior consistent with native Julia arrays.