many fixes in matrix and mainly quaternion code