Added convert for matrix types.