fixed mattype initialization bug