Fixed bug in quaternion to matrix conversion