Add 'throw if index out of bounds' test