fixed Arg1 in write-matrices