Fix matrix quaternion computations.