fix matToCvmat