diff --git a/rigify/rig_ui_template.py b/rigify/rig_ui_template.py
index a54ab17577d252d463b15ae29de505edf27a5d70..f21c409667bede34a817bcb1e886e11293368c55 100644
--- a/rigify/rig_ui_template.py
+++ b/rigify/rig_ui_template.py
@@ -81,7 +81,7 @@ def set_pose_translation(pose_bone, mat):
             par_rest = Matrix()
 
         q = (par_rest.inverted() * rest).to_quaternion()
-        pose_bone.location = loc * q
+        pose_bone.location = q * loc
 
 
 def set_pose_rotation(pose_bone, mat):
@@ -200,7 +200,7 @@ def match_pole_target(ik_first, ik_last, pole, match_bone, length):
 
     # Compensate for the rotation difference
     if angle > 0.0001:
-        pv *= Matrix.Rotation(angle, 4, ikv).to_quaternion()
+        pv = Matrix.Rotation(angle, 4, ikv).to_quaternion() * pv
         set_pole(pv)
 
         # Get rotation difference again, to see if we
@@ -210,7 +210,7 @@ def match_pole_target(ik_first, ik_last, pole, match_bone, length):
         angle2 = acos(min(1,max(-1,q1.dot(q2)))) * 2
         if angle2 > 0.0001:
             # Compensate in the other direction
-            pv *= Matrix.Rotation((angle*(-2)), 4, ikv).to_quaternion()
+            pv = Matrix.Rotation((angle*(-2)), 4, ikv).to_quaternion() * pv
             set_pole(pv)