ensure matrix format before saving in txt
fix typo
support mfe format