Fixing the tensor function derivative.  Some entries were being incorrectly divided by a sqrt(2).