Some fixes to mat2json.m