Added multiplication by TENSOR_DIMENSIONS to matrix offset so offset is correct