Fix matrix quaternion computations.
Added missing test case
Merge pull request #405 from shans/fixMatrixRotation

Fix matrix quaternion computations.