fix panic in mflag

ping @tianon