Clear warning state properly
Merge pull request #1374 from ke-yu/fix_magn2378

Clear warning state properly