Raise IndexError instead of RuntimeError