bug fix in rgt2mtx