Fix some bug of mgt