fixed error in 'canonicalize' function

I forgot to move one of the updated tensors, which means I didn't go back to the original state