Add array bounds checking, and IndexError