Fix bug in error and Jacobian computations.

  Dispatch to position and orientation constraints depends on mask.