Use ArgumentError instead of Generic error
Test #[], #slice and #at with unknown object