ivy: matrix inner product
ivy: fix bug at EOF: backup would index off beginning of input