Made tensor class more const-correct.