Fix Jacobian determinant bug in ComputeBasisFunctions.

Variables were being reused when they should not be. This was causing sign flips
and 0s, which propagated into downstream quantities.