Cleanup of the Tensor reduction code in the last commit.