Add error checking for index bounds on tape.
Add max cycle support.