Fix quaternion <-> matrix conversions