Improvements to TensorUtils and minor fix for makerow/makecol